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

flowchart TD A[Installation, devices, ecosystem status] --> B[Tensors, variables, autodiff] B --> C[tf.function, modules, core training loop] A --> D[Keras 3 overview] D --> E[Sequential, Functional, subclassing, layers] E --> F[Losses, metrics, optimizers, compile and fit, callbacks] F --> G[Custom train step, custom training loop] F --> H[tf.data, TFDS, data loading] F --> I[Saving, SavedModel, checkpoints] G --> J[CNNs, text, transformers, transfer learning] J --> K[Distribution, mixed precision, XLA, TensorBoard] I --> L[Serving, LiteRT, quantisation] D --> M[Multi-backend, KerasHub, KerasTuner]

Concept-to-page map

Getting started

Page What it covers

Installation: pip, GPU, WSL2 & macOS

Installing TensorFlow with pip, GPU support, WSL2 and macOS.

Devices: CPUs, GPUs & TPUs

Running on CPUs, GPUs and TPUs, device placement and memory growth.

Ecosystem & Project Status

The state of the TensorFlow ecosystem: what is maintained, archived or moved.

TensorFlow Core

Page What it covers

Tensors, Dtypes & Random Numbers

Tensors, dtypes and random numbers.

Variables

tf.Variable, assignment and variable creation.

Ragged & Sparse Tensors

Ragged and sparse tensors.

NumPy Interop & tf.experimental.numpy

Moving between NumPy and TensorFlow, and tf.experimental.numpy.

Automatic Differentiation with GradientTape

Automatic differentiation with GradientTape.

Graphs, tf.function, AutoGraph & Retracing

Graphs, tf.function, AutoGraph and retracing.

Modules (tf.Module)

tf.Module for tracking variables and building reusable components.

A Training Loop with TF Core

A training loop written with TensorFlow Core only.

Keras 3

Page What it covers

Keras 3 Overview: keras, tf.keras & tf_keras

Keras 3 and how keras, tf.keras and tf_keras relate.

Sequential & Functional Models

Building models with the Sequential and Functional APIs.

Subclassing & Custom Layers

Subclassing models and writing custom layers.

Core Keras Layers

The core Keras layers.

Keras Preprocessing Layers

Preprocessing layers for text, images and structured data.

Losses

Built-in and custom losses.

Metrics

Built-in and custom metrics.

Optimizers & Learning-Rate Schedules

Optimizers and learning-rate schedules.

compile, fit, evaluate & predict

compile, fit, evaluate and predict.

Callbacks

Built-in and custom callbacks.

Customizing fit() with train_step

Customising fit with train_step.

Writing a Training Loop from Scratch

Writing a training loop from scratch.

Keras Multi-Backend: JAX, PyTorch & keras.ops

Running Keras on JAX, PyTorch or TensorFlow, and keras.ops.

Loading Images, Text & Audio from Disk

Loading images, text and audio from disk.

Hyperparameter Tuning with KerasTuner

Hyperparameter tuning with KerasTuner.

Pre-trained Models with KerasHub

Pre-trained models with KerasHub.

Data and persistence

Page What it covers

Input Pipelines with tf.data & TFRecord

Input pipelines with tf.data and TFRecord.

tf.data Performance

Making tf.data pipelines fast.

TensorFlow Datasets (TFDS)

TensorFlow Datasets (TFDS).

Saving Keras Models: .keras, Weights & export

Saving Keras models in the .keras format, weights and export.

SavedModel & Signatures

SavedModel and signatures.

Training Checkpoints

Training checkpoints.

Models and worked topics

Page What it covers

Image Classification with CNNs

Image classification with CNNs, augmentation and overfitting.

Text, RNNs & Embeddings

Text, RNNs and embeddings.

Attention & Transformers

Attention and transformers in TensorFlow and Keras.

Transfer Learning & Fine-Tuning

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

Mixed precision with Keras and TensorFlow.

Performance, XLA & Profiling

Performance tuning, XLA and the profiler.

TensorBoard

Logging and visualising with TensorBoard.

Quantization & Model Optimization

Quantisation and model optimisation.

Deployment and ecosystem

Page What it covers

Serving with TensorFlow Serving

Serving models with TensorFlow Serving.

On-Device Inference with LiteRT

On-device inference with LiteRT, the successor of TensorFlow Lite.

TF.js, TFX & TF Probability (Positioning)

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

Migrating from Keras 2 to Keras 3.

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

  • Word embeddings and Transformer tutorial

  • 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

Ecosystem

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.