TensorFlow
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
TensorFlow is Google’s machine-learning platform: tensors and automatic differentiation in TensorFlow Core, the Keras high-level API, the tf.data input pipeline, SavedModel for saving and serving, and a set of deployment tools. This sub-section of the ML (Machine Learning) section documents it page by page, with most of the weight on Keras 3, which is how most people use it today.
Version baseline and the 2026 maintenance focus
| Item | Value checked on 2026-10-30 |
|---|---|
TensorFlow |
2.21.0. All pages target this release. |
TensorFlow 2.22 |
Upcoming. It is mentioned only where the project has announced a change, and is labelled upcoming each time. |
Keras |
3.15.1, installed as the separate keras package. |
Python |
3.13. Examples were run on Python 3.13 with TensorFlow 2.21 and Keras 3.15 on CPU (macOS arm64) on 2026-10-31. Examples that need a GPU, a TPU, several machines, a TensorFlow Serving container, a browser or a mobile device were not executed, and each page says which. |
In 2026 TensorFlow is in a maintenance-focused phase: releases concentrate on stability, security fixes and compatibility rather than new high-level features, new research code is more often written in PyTorch or JAX, and several former companions are archived, renamed or moved (TensorFlow Lite is now LiteRT, TensorFlow Addons is archived and TF Hub moved to Kaggle Models). The page Ecosystem & Project Status gives the current status of each component, and Migrating from TensorFlow 1 lists what is outdated in older books.
Keras inside TensorFlow
Keras 3 is a multi-backend library that can run on TensorFlow, JAX or PyTorch. With the TensorFlow backend it is the standard high-level API of TensorFlow: models are built with Sequential, Functional or subclassed APIs, trained with compile and fit, and saved in the .keras format or exported as a SavedModel. Since TensorFlow 2.16, tf.keras is Keras 3 too; only the separate tf_keras package, selected by setting TF_USE_LEGACY_KERAS=1 before TensorFlow is imported, keeps Keras 2 behaviour for old code, and the two cannot be mixed in one process. The pages Keras 3 Overview: keras, tf.keras & tf_keras, Keras Multi-Backend and Migrating from Keras 2 to Keras 3 explain how the pieces relate.
Reading path
Concept-to-page map
Getting started
| Page | What it covers |
|---|---|
Installing TensorFlow with pip, GPU support, WSL2 and macOS. |
|
Running on CPUs, GPUs and TPUs, device placement and memory growth. |
|
The state of the TensorFlow ecosystem: what is maintained, archived or moved. |
TensorFlow Core
| Page | What it covers |
|---|---|
Tensors, dtypes and random numbers. |
|
tf.Variable, assignment and variable creation. |
|
Ragged and sparse tensors. |
|
Moving between NumPy and TensorFlow, and tf.experimental.numpy. |
|
Automatic differentiation with GradientTape. |
|
Graphs, tf.function, AutoGraph and retracing. |
|
tf.Module for tracking variables and building reusable components. |
|
A training loop written with TensorFlow Core only. |
Keras 3
| Page | What it covers |
|---|---|
Keras 3 and how keras, tf.keras and tf_keras relate. |
|
Building models with the Sequential and Functional APIs. |
|
Subclassing models and writing custom layers. |
|
The core Keras layers. |
|
Preprocessing layers for text, images and structured data. |
|
Built-in and custom losses. |
|
Built-in and custom metrics. |
|
Optimizers and learning-rate schedules. |
|
compile, fit, evaluate and predict. |
|
Built-in and custom callbacks. |
|
Customising fit with train_step. |
|
Writing a training loop from scratch. |
|
Running Keras on JAX, PyTorch or TensorFlow, and keras.ops. |
|
Loading images, text and audio from disk. |
|
Hyperparameter tuning with KerasTuner. |
|
Pre-trained models with KerasHub. |
Data and persistence
| Page | What it covers |
|---|---|
Input pipelines with tf.data and TFRecord. |
|
Making tf.data pipelines fast. |
|
TensorFlow Datasets (TFDS). |
|
Saving Keras models in the .keras format, weights and export. |
|
SavedModel and signatures. |
|
Training checkpoints. |
Models and worked topics
| Page | What it covers |
|---|---|
Image classification with CNNs, augmentation and overfitting. |
|
Text, RNNs and embeddings. |
|
Attention and transformers in TensorFlow and Keras. |
|
Transfer learning and fine-tuning. |
Scaling and performance
| Page | What it covers |
|---|---|
Distributed Training: tf.distribute & the Keras Distribution API |
tf.distribute and the Keras distribution API. |
Mixed precision with Keras and TensorFlow. |
|
Performance tuning, XLA and the profiler. |
|
Logging and visualising with TensorBoard. |
|
Quantisation and model optimisation. |
Deployment and ecosystem
| Page | What it covers |
|---|---|
Serving models with TensorFlow Serving. |
|
On-device inference with LiteRT, the successor of TensorFlow Lite. |
|
Where TF.js, TFX and TensorFlow Probability fit. |
Migration
| Page | What it covers |
|---|---|
Migrating from TensorFlow 1, where older books and tutorials are outdated |
Migrating from TensorFlow 1, and why older books and tutorials are outdated. |
Migrating from Keras 2 to Keras 3. |
Related material on this site
The general pages that these pages build on include Backpropagation & Automatic Differentiation, Distributed Training Concepts, ONNX & Model Interoperability and Choosing a Framework. Return to the ML (Machine Learning) landing page for the whole section.
Bibliography
All official links below were opened on 2026-10-30. Books and general sources for the whole section are listed in the ML bibliography.
Guides and tutorials
-
TensorFlow guides: tensor, variable, ragged_tensor, sparse_tensor, tf_numpy, random_numbers, autodiff, advanced_autodiff, intro_to_graphs, function, intro_to_modules, basic_training_loops, core, data, data_performance, saved_model, checkpoint, mixed_precision, distributed_training, dtensor_overview, profiler, gpu_performance_analysis, keras, keras/preprocessing_layers, migrate, migrate/tf1_vs_tf2 and migrate/upgrade
-
TensorFlow tutorials: load_data/tfrecord, images/cnn, images/classification, images/data_augmentation, images/transfer_learning, keras/text_classification, keras/keras_tuner, keras/save_and_load, distribute/keras, distribute/multi_worker_with_keras and distribute/parameter_server_training
-
XLA and TensorBoard
Keras
-
Keras 3, Getting started and Guides: sequential_model, functional_api, making_new_layers_and_models_via_subclassing, training_with_built_in_methods, writing_your_own_callbacks, custom_train_step_in_tensorflow, writing_a_custom_training_loop_in_tensorflow, serialization_and_saving, transfer_learning, distribution, distributed_training_with_tensorflow, orbax_checkpoint, quantization_overview, litert_export and migrating_to_keras_3
-
Keras API: layers, preprocessing layers, losses, metrics, optimizers, learning-rate schedules, callbacks, data loading, ops, random, mixed precision, model training and saving APIs, export and scikit-learn wrappers
-
KerasHub (repository) and KerasTuner
-
Keras releases, tf_keras and KerasCV (archived)
-
Keras 3.15.1 source used to confirm behaviour: saving_api.py and preprocessing image API
Deployment
-
LiteRT: overview, migration, conversion, optimisation, ai-edge-litert and litert-torch
-
TensorFlow Model Optimization: documentation and repository
Ecosystem
-
TFX, TF.js (documentation, releases) and TensorFlow Probability (documentation, releases)
-
TensorFlow Datasets, TF Hub (moved to Kaggle Models; repository), TF Addons (archived) and TF-Agents
-
tensorflow-text and tensorboard on PyPI
Sources cited by individual pages
The official sources below are cited in the References section of one page each; a source shared by several pages is listed once, under the first page that cites it.
-
NumPy Interop & tf.experimental.numpy
-
TensorFlow guide, NumPy API on TensorFlow: https://www.tensorflow.org/guide/tf_numpy
-
TensorFlow API,
tf.experimental.numpy: https://www.tensorflow.org/api_docs/python/tf/experimental/numpy -
TensorFlow API,
tf.vectorized_map: https://www.tensorflow.org/api_docs/python/tf/vectorized_map
-
-
Automatic Differentiation with GradientTape
-
TensorFlow guide, Advanced automatic differentiation: https://www.tensorflow.org/guide/advanced_autodiff
-
TensorFlow API,
tf.GradientTape: https://www.tensorflow.org/api_docs/python/tf/GradientTape -
TensorFlow API,
tf.custom_gradient: https://www.tensorflow.org/api_docs/python/tf/custom_gradient -
TensorFlow API,
tf.stop_gradient: https://www.tensorflow.org/api_docs/python/tf/stop_gradient -
TensorFlow API,
tf.autodiff.ForwardAccumulator: https://www.tensorflow.org/api_docs/python/tf/autodiff/ForwardAccumulator -
Keras optimizers API: https://keras.io/api/optimizers/
-
-
Graphs, tf.function, AutoGraph & Retracing
-
TensorFlow guide, Introduction to graphs and tf.function: https://www.tensorflow.org/guide/intro_to_graphs
-
TensorFlow API,
tf.function: https://www.tensorflow.org/api_docs/python/tf/function -
TensorFlow API,
tf.autograph: https://www.tensorflow.org/api_docs/python/tf/autograph -
TensorFlow guide, Graph optimization (Grappler): https://www.tensorflow.org/guide/graph_optimization
-
TensorFlow API,
tf.config.run_functions_eagerly: https://www.tensorflow.org/api_docs/python/tf/config/run_functions_eagerly
-
-
-
Introduction to modules, layers and models: https://www.tensorflow.org/guide/intro_to_modules
-
tf.ModuleAPI: https://www.tensorflow.org/api_docs/python/tf/Module -
Training checkpoints: https://www.tensorflow.org/guide/checkpoint
-
Using the SavedModel format: https://www.tensorflow.org/guide/saved_model
-
-
-
TensorFlow Core guides: https://www.tensorflow.org/guide/core
-
tf.data guide: https://www.tensorflow.org/guide/data
-
Keras model training APIs: https://keras.io/api/models/model_training_apis/
-
-
Keras 3 Overview: keras, tf.keras & tf_keras
-
keras.opsreference: https://keras.io/api/ops/ -
TensorFlow Keras guide: https://www.tensorflow.org/guide/keras
-
-
Sequential & Functional Models
-
Sequential model guide: https://keras.io/guides/sequential_model/
-
Functional API guide: https://keras.io/guides/functional_api/
-
Model API reference: https://keras.io/api/models/
-
-
-
Making new layers and models via subclassing: https://keras.io/guides/making_new_layers_and_models_via_subclassing/
-
Serialization and saving guide: https://keras.io/guides/serialization_and_saving/
-
Model API: https://keras.io/api/models/model/
-
-
-
Layers API overview: https://keras.io/api/layers/
-
Core layers (Dense, Embedding): https://keras.io/api/layers/core_layers/
-
Convolution layers: https://keras.io/api/layers/convolution_layers/
-
Pooling layers: https://keras.io/api/layers/pooling_layers/
-
Recurrent layers: https://keras.io/api/layers/recurrent_layers/
-
Normalization layers: https://keras.io/api/layers/normalization_layers/
-
Regularization layers: https://keras.io/api/layers/regularization_layers/
-
Attention layers: https://keras.io/api/layers/attention_layers/
-
-
Keras Multi-Backend: JAX, PyTorch & keras.ops
-
Keras guide: Writing a training loop from scratch in JAX - https://keras.io/guides/writing_a_custom_training_loop_in_jax/
-
Keras guide: Writing a training loop from scratch in PyTorch - https://keras.io/guides/writing_a_custom_training_loop_in_torch/
-
Keras guide: Distributed training with the Keras distribution API - https://keras.io/guides/distribution/
-
Keras API: Backend-specific layers - https://keras.io/api/layers/backend_specific_layers/
-
-
Hyperparameter Tuning with KerasTuner
-
KerasTuner API: Tuners - https://keras.io/keras_tuner/api/tuners/
-
KerasTuner API: HyperParameters - https://keras.io/keras_tuner/api/hyperparameters/
-
KerasTuner API: HyperModels - https://keras.io/keras_tuner/api/hypermodels/
-
KerasTuner getting started guide - https://keras.io/guides/keras_tuner/getting_started/
-
TensorFlow tutorial: Introduction to the Keras Tuner - https://www.tensorflow.org/tutorials/keras/keras_tuner
-
Google Deep Learning Tuning Playbook - https://developers.google.com/machine-learning/guides/deep-learning-tuning-playbook
-
-
Distributed Training: tf.distribute & the Keras Distribution API
-
TensorFlow tutorial, Multi-worker training with Keras: https://www.tensorflow.org/tutorials/distribute/multi_worker_with_keras
-
TensorFlow tutorial, Parameter server training: https://www.tensorflow.org/tutorials/distribute/parameter_server_training
-
Keras guide, Multi-GPU distributed training with TensorFlow: https://keras.io/guides/distributed_training_with_tensorflow/
-
-
-
TensorFlow guide, Mixed precision: https://www.tensorflow.org/guide/mixed_precision
-
Keras API, Mixed precision policy: https://keras.io/api/mixed_precision/
-
-
-
TensorFlow guide, Optimize GPU performance: https://www.tensorflow.org/guide/gpu_performance_analysis
-
TensorFlow, XLA overview: https://www.tensorflow.org/xla
-
-
-
TensorBoard, Hyperparameter tuning with the HParams dashboard: https://www.tensorflow.org/tensorboard/hyperparameter_tuning_with_hparams
-
TensorBoard, Scalars, graphs and images guides: https://www.tensorflow.org/tensorboard
-
-
Quantization & Model Optimization
-
Keras quantization overview: https://keras.io/guides/quantization_overview/
-
LiteRT post-training quantization: https://developers.google.com/edge/litert/conversion/tensorflow/quantization/post_training_quantization
-
-
Serving with TensorFlow Serving
-
Serving a TensorFlow model (export layout, older API): https://www.tensorflow.org/tfx/serving/serving_basic
-
Advanced model server configuration (config file, labels, batching): https://www.tensorflow.org/tfx/serving/serving_config
-
Client REST API: https://www.tensorflow.org/tfx/serving/api_rest
-
-
On-Device Inference with LiteRT
-
litert-torchon PyPI: https://pypi.org/project/litert-torch/ and repository https://github.com/google-ai-edge/litert-torch
-
-
TF.js, TFX & TF Probability (Positioning)
-
TensorFlow.js conversion tutorial: https://www.tensorflow.org/js/tutorials/conversion/import_saved_model
-
TFX: https://www.tensorflow.org/tfx and https://github.com/tensorflow/tfx
-
TensorFlow Probability: https://www.tensorflow.org/probability and https://github.com/tensorflow/probability
-
-
Migrating from TensorFlow 1, where older books and tutorials are outdated
-
Migrate to TensorFlow 2 (overview) - https://www.tensorflow.org/guide/migrate
-
TF1.x vs TF2 behaviours - https://www.tensorflow.org/guide/migrate/tf1_vs_tf2
-
Automatic upgrade script (
tf_upgrade_v2) - https://www.tensorflow.org/guide/migrate/upgrade
-
-
Migrating from Keras 2 to Keras 3
-
SciKeras - https://github.com/adriangb/scikeras
-