Skip to main content
Install
Learn
Introduction
New to TensorFlow?
Tutorials
Learn how to use TensorFlow with end-to-end examples
Guide
Learn framework concepts and components
Learn ML
Educational resources to master your path with TensorFlow
API
TensorFlow (v2.16.1)
Versions…
TensorFlow.js
TensorFlow Lite
TFX
Ecosystem
LIBRARIES
TensorFlow.js
Develop web ML applications in JavaScript
TensorFlow Lite
Deploy ML on mobile, microcontrollers and other edge devices
TFX
Build production ML pipelines
All libraries
Create advanced models and extend TensorFlow
RESOURCES
Models & datasets
Pre-trained models and datasets built by Google and the community
Tools
Tools to support and accelerate TensorFlow workflows
Responsible AI
Resources for every stage of the ML workflow
Recommendation systems
Build recommendation systems with open source tools
Community
Groups
User groups, interest groups and mailing lists
Contribute
Guide for contributing to code and documentation
Blog
Stay up to date with all things TensorFlow
Forum
Discussion platform for the TensorFlow community
Why TensorFlow
About
Case studies
/
English
中文 – 简体
GitHub
Sign in
TensorFlow v2.16.1
Overview
Python
C++
Java
More
Install
Learn
More
API
More
Overview
Python
C++
Java
More
Ecosystem
More
Community
More
Why TensorFlow
More
GitHub
Overview
TensorFlow Models
tfm
Overview
tfm.core
Overview
actions
Overview
EMACheckpointing
PruningAction
RecoveryAction
RecoveryCondition
get_eval_actions
get_train_actions
base_task
Overview
DifferentialPrivacyConfig
RuntimeConfig
Task
base_trainer
Overview
ExperimentConfig
Trainer
TrainerConfig
get_runtime_options
config_definitions
Overview
DataConfig
TaskConfig
exp_factory
Overview
get_exp_config
register_config_factory
export_base
Overview
ExportModule
export
get_timestamped_export_dir
file_writers
Overview
write_small_dataset
input_reader
Overview
InputReader
match_files
registry
Overview
lookup
register
savedmodel_checkpoint_manager
Overview
SavedModelCheckpointManager
make_saved_modules_directory_name
task_factory
Overview
get_task
get_task_cls
register_task_cls
tf_example_builder
Overview
BytesValueType
TfExampleBuilder
tf_example_feature_key
Overview
TfExampleFeatureKeyBase
dataclass
train_lib
Overview
OrbitExperimentRunner
maybe_create_best_ckpt_exporter
run_experiment
train_utils
Overview
BestCheckpointExporter
ExperimentParser
ParseConfigOptions
cast_leaf_nested_dict
convert_variables_to_constants_v2_as_graph
create_optimizer
create_trainer
get_leaf_nested_dict
parse_configuration
read_global_step_from_checkpoint
remove_ckpts
save_gin_config
serialize_config
try_count_flops
try_count_params
write_json_summary
write_model_params
write_summary
tfm.hyperparams
Overview
Config
OneOfConfig
ParamsDict
bind
nested_csv_str_to_json_str
override_params_dict
read_yaml_to_params_dict
save_params_dict_to_yaml
base_config
Overview
oneof
Overview
params_dict
Overview
tfm.nlp
Overview
encoders
Overview
AlbertEncoderConfig
BertEncoderConfig
BigBirdEncoderConfig
EncoderConfig
FNetEncoderConfig
FunnelEncoderConfig
KernelEncoderConfig
MobileBertEncoderConfig
QueryBertConfig
ReuseEncoderConfig
SparseMixerEncoderConfig
XLNetEncoderConfig
build_encoder
layers
Overview
BertPackInputs
BertTokenizer
BigBirdAttention
BigBirdMasks
BlockDiagFeedforward
CachedAttention
ClassificationHead
ExpertsChooseMaskedRouter
FactorizedEmbedding
FastWordpieceBertTokenizer
FeedForwardExperts
FourierTransformLayer
GatedFeedforward
GaussianProcessClassificationHead
HartleyTransformLayer
KernelAttention
KernelMask
LinearTransformLayer
MaskedLM
MaskedSoftmax
MatMulWithMargin
MixingMechanism
MobileBertEmbedding
MobileBertMaskedLM
MobileBertTransformer
MoeLayer
MoeLayerWithBackbone
MultiChannelAttention
MultiClsHeads
MultiHeadRelativeAttention
OnDeviceEmbedding
PackBertEmbeddings
PerDimScaleAttention
PerQueryDenseHead
PositionEmbedding
RandomFeatureGaussianProcess
ReZeroTransformer
RelativePositionBias
RelativePositionEmbedding
ReuseMultiHeadAttention
ReuseTransformer
SelectTopK
SelfAttentionMask
SentencepieceTokenizer
SpectralNormalization
SpectralNormalizationConv2D
StridedTransformerEncoderBlock
StridedTransformerScaffold
TNTransformerExpandCondense
TalkingHeadsAttention
TokenImportanceWithMovingAvg
Transformer
TransformerDecoderBlock
TransformerEncoderBlock
TransformerScaffold
TransformerXL
TransformerXLBlock
TwoStreamRelativeAttention
VotingAttention
extract_gp_layer_kwargs
extract_spec_norm_kwargs
get_mask
util
Overview
TfFunctionIfEagerDecorator
filter_kwargs
tf_function_if_eager
losses
Overview
weighted_sparse_categorical_crossentropy_loss
models
Overview
BertClassifier
BertPretrainer
BertPretrainerV2
BertSpanLabeler
BertTokenClassifier
DualEncoder
ElectraPretrainer
Seq2SeqTransformer
T5Transformer
T5TransformerParams
TransformerDecoder
TransformerEncoder
XLNetClassifier
XLNetPretrainer
XLNetSpanLabeler
attention_initializer
networks
Overview
AlbertEncoder
BertEncoder
BertEncoderV2
Classification
EncoderScaffold
FNet
FunnelTransformerEncoder
MobileBERTEncoder
PackedSequenceEmbedding
SpanLabeling
SparseMixer
XLNetBase
XLNetSpanLabeling
ops
Overview
SamplingModule
SequenceBeamSearch
get_next_sentence_labels
get_sentence_order_labels
sequence_beam_search
serving_modules
Overview
MaskedLM
MaskedLM.Params
QuestionAnswering
QuestionAnswering.Params
SentencePrediction
SentencePrediction.Params
Tagging
Tagging.Params
Translation
Translation.Params
features_to_int32
tasks
Overview
ElectraPretrainConfig
ElectraPretrainTask
MaskedLMConfig
MaskedLMTask
QuestionAnsweringConfig
QuestionAnsweringTask
SentencePredictionConfig
SentencePredictionTask
TaggingConfig
TaggingTask
TranslationConfig
TranslationTask
tfm.optimization
Overview
AdafactorConfig
AdagradConfig
AdamConfig
AdamExperimentalConfig
AdamWeightDecayConfig
AdamWeightDecayExperimentalConfig
BaseOptimizerConfig
ConstantLrConfig
CosineDecayWithOffset
CosineDecayWithOffset.base_lr_class
CosineLrConfig
DirectPowerDecay
DirectPowerLrConfig
EMAConfig
ExponentialDecayWithOffset
ExponentialDecayWithOffset.base_lr_class
ExponentialLrConfig
ExponentialMovingAverage
LAMBConfig
LARSConfig
LinearWarmup
LinearWarmupConfig
LrConfig
OptimizationConfig
OptimizerConfig
OptimizerFactory
PiecewiseConstantDecayWithOffset
PiecewiseConstantDecayWithOffset.base_lr_class
PolynomialDecayWithOffset
PolynomialDecayWithOffset.base_lr_class
PolynomialLrConfig
PolynomialWarmUp
PolynomialWarmupConfig
PowerAndLinearDecay
PowerAndLinearDecayLrConfig
PowerDecayWithOffset
PowerDecayWithOffsetLrConfig
RMSPropConfig
SGDConfig
SGDExperimentalConfig
SLIDEConfig
StepCosineDecayWithOffset
StepCosineLrConfig
StepwiseLrConfig
WarmupConfig
register_optimizer_cls
adafactor_optimizer
Overview
configs
Overview
ema_optimizer
Overview
maybe_merge_call
lamb
Overview
FloatTensorLike
LAMB
lars
Overview
LARS
legacy_adamw
Overview
AdamWeightDecay
lr_cfg
Overview
lr_schedule
Overview
math
Overview
acos
acosh
asin
asinh
atan
atan2
atanh
ceil
comb
copysign
cos
cosh
degrees
dist
erf
erfc
exp
expm1
fabs
factorial
floor
fmod
frexp
fsum
gamma
gcd
hypot
isclose
isfinite
isinf
isnan
isqrt
lcm
ldexp
lgamma
log
log10
log1p
log2
modf