blog.dopana

Back

TensorFlow is Google’s open-source machine learning framework — an end-to-end platform covering data loading, model training, and production deployment. First released by the Google Brain team on November 9, 2015. Written in Python, C++, and CUDA. Latest release: 2.21.0 (March 2026), ~197k GitHub stars, Apache 2.0 license.

What Makes TensorFlow Different?#

TensorFlow is not just a training library — it’s an ecosystem:

ComponentPurpose
Core frameworkTensor ops, eager execution, XLA compiler
KerasHigh-level model-building API
tf.dataScalable data pipelines
TensorFlow ServingProduction model serving (REST/gRPC)
LiteRTOn-device inference (mobile, embedded)
TensorFlow.jsIn-browser ML (WebGPU/WASM)
TFXEnd-to-end production ML pipelines
XLAGraph compiler for GPU/TPU

Core Concepts#

Tensors#

Everything is a tensor — a multi-dimensional array:

import tensorflow as tf

x = tf.constant([[1, 2], [3, 4]], dtype=tf.float32)
y = tf.matmul(x, x)          # Matrix multiply
print(y.shape)               # (2, 2)
python

Eager Execution#

TF 2.x executes operations eagerly (like normal Python) by default — easy to debug. The static-graph API lives in tf.compat for legacy code.

XLA Compiler#

@tf.function(jit_compile=True)
def compute(x, w):
    return tf.matmul(x, w)
python

tf.function traces the code into a graph, then XLA (Accelerated Linear Algebra) compiles and fuses ops for GPU/TPU — often 5-50x speedups on compute-heavy models.

History#

VersionYearChange
TF 1.x2015Static computation graphs, session.run()
TF 2.02019Eager execution by default, Keras integrated
TF 2.16-2.202024-2025Keras 3 backend, Python 3.13 support
TF 2.21Mar 2026Latest stable release

Getting Started#

pip install tensorflow # CPU + GPU (NVIDIA CUDA)
pip install tensorflow-cpu # CPU-only, much smaller
bash

GPU & TPU Support#

  • GPU: NVIDIA CUDA out of the box; DirectX and macOS Metal via device plugins
  • TPU: TensorFlow is the reference framework for Google TPUs (Tensor Processing Units) — XLA was built for them. This is where TensorFlow still beats PyTorch by a wide margin
  • Distributed training: tf.distribute (MirroredStrategy, MultiWorkerMirroredStrategy, TPUStrategy)

Who Uses It#

  • YouTube recommendation engine
  • Waymo self-driving fleet
  • Google-scale TPU training (Gemini trains on a JAX + TensorFlow mix)
  • Large production stacks relying on TFX + TensorFlow Serving

Strengths & Weaknesses (2026)#

Strengths:

  • Mature production ecosystem (Serving, TFX, LiteRT) — most deployed ML runtime in the world
  • Best-in-class TPU support and XLA maturity
  • Keras 3 means your models can run on PyTorch or JAX backends too
  • 197k stars, Google-backed, huge maintenance effort

Weaknesses:

  • Losing research mindshare — PyTorch now >55% of published papers
  • Hugging Face tooling is PyTorch-first; TF checkpoints are auto-converted
  • Legacy static-graph API still leaks complexity
  • Python API install is large (~570 MB GPU wheel)

Conclusion#

TensorFlow remains the production workhorse: it powers some of the largest ML systems in the world and owns mobile (LiteRT), browser (TF.js), and TPU territory. For new research, PyTorch dominates; for Google-cloud, TPU, on-device, and large-scale serving stacks, TensorFlow is still the safest bet — and Keras 3 now lets you hedge against lock-in entirely.

References#