Skip to content

TensorFlow or PyTorch? Just Pick One (Here’s Which)

Start new projects in PyTorch unless one of a few specific conditions applies. The evidence as of October 2026, a decision table by deployment target, and a benchmark you can run yourself.

The Short Answer You Came Here For

You have a model to build and an hour to settle the framework question, so the answer comes first. For the TensorFlow vs PyTorch decision, start a new project in PyTorch unless you inherit working TensorFlow code, need TensorFlow.js without an export step, or ship through a TensorFlow-only toolchain. The sections below give the evidence, what changed since March 2026, a table by deployment target, and a speed test you can run on your own hardware.

The strongest signal is the model supply chain. Hugging Face’s Transformers v5 announcement (December 1, 2025) says the team is “sunsetting our Flax/TensorFlow support in favor of focusing on PyTorch as the sole backend,” and GitHub’s release list now shows the 5.x series, with v5.19.0 published on October 6. If your first step is fine-tuning a pretrained model from that library, the current major version has no TensorFlow path. The PyTorch Foundation, hosted by the Linux Foundation, also lists vLLM, DeepSpeed, Ray, Helion and Safetensors alongside PyTorch itself.

The second signal is pace. The PyTorch release list shows four minor releases since mid-March (2.11 on March 23 through 2.14 on September 2). TensorFlow’s latest stable release, 2.21.0, dates from March 6, with a 2.22.0 release candidate on September 24. Pace is not quality, and TensorFlow is not abandoned.

Here is the decision matrix. If neither column describes you, start with PyTorch.

What Changed Since March 2026

ComponentWhere it stands on October 15, 2026
PyTorchGitHub marks 2.14.1 (September 30) as the latest release. Releases since mid-March: 2.11.0 (March 23), 2.12.0 (May 13), 2.13.0 (July 8), 2.14.0 (September 2). Check your pinned version against the release notes before you copy older tutorials.
TensorFlow2.21.0 (March 6) is still marked Latest. It dropped Python 3.9 and stopped bundling TensorBoard. The 2.22.0-rc0 notes (September 24) say TensorBoard is no longer installed by default, so code that uses tf.summary or the TensorBoard callback needs it installed separately.
Hugging Face TransformersThe 5.x series is current (v5.19.0 on October 6), and PyTorch is its only backend per the v5 announcement.
ExecuTorch (PyTorch on devices)v1.5.1 (September 23) is marked Latest; v1.2.0 shipped on April 1.
LiteRT (built on TensorFlow Lite)The TensorFlow 2.19 release notes point tf.lite.Interpreter users to ai_edge_litert.interpreter, and the 2.20 notes say tf.lite “will be deprecated, in favor of the new repo.” Google’s LiteRT page describes LiteRT as built on TensorFlow Lite, with export from PyTorch, TensorFlow and JAX.
PyTorch on TPUsThe PyTorch/XLA docs carry an April 22, 2026 notice: “Once TorchTPU is public it will replace PyTorch/XLA.”

Choosing by Deployment Target

Where the model runs decides more than where it was trained. The table lists each target with the documented route from each framework, and two rows differ from what this post said in March.

TargetPyTorch routeTensorFlow route
GPU serverRun eager code, add torch.compile. TorchServe is no longer an option for new work: its repository was archived on August 7, 2025, with “no planned updates, bug fixes, new features, or security patches.” For LLMs, vLLM is a PyTorch Foundation project.TensorFlow Serving, described by TensorFlow as “a flexible, high-performance serving system for machine learning models, designed for production environments.” GPU training needs Linux or WSL2, because native Windows GPU support ended after TensorFlow 2.10.
Phone, embedded, microcontrollerExecuTorch: Android and iOS, desktop, embedded and MCUs.LiteRT: Android, iOS, web, Linux, macOS, Windows, and microcontrollers. It also exports PyTorch and JAX models to .tflite, so the framework you train in no longer decides this row.
BrowserExport to ONNX and run with ONNX Runtime Web (webgl, webgpu, webnn or wasm). All ONNX operators run on wasm, but only a subset on the GPU backends.TensorFlow.js, which runs in the browser or Node.js and can convert Python TensorFlow models. Its page shows no deprecation notice.
TPUPyTorch/XLA, with the TorchTPU notice above.XLA is a shared compiler. The OpenXLA page says it is integrated in TensorFlow, PyTorch and JAX, and the JAX docs say JAX code runs on CPU, GPU and TPU.

The phone row and the TPU row are where the March version of this post said to pick TensorFlow. Both now have a documented PyTorch route. The browser row is the one place where TensorFlow still offers a one-step path, and even there ONNX Runtime Web covers PyTorch models after an export.

Does Speed Decide It?

Not on the published numbers, because the published numbers do not compare the two frameworks with each other. PyTorch’s own PyTorch 2.x page, written at the 2.0 launch, reports that across 163 open-source models torch.compile works 93% of the time and runs 43% faster in training on an NVIDIA A100, with 21% on average at Float32 and 51% with automatic mixed precision. It adds that desktop-class GPUs such as the NVIDIA 3090 see smaller gains. TensorFlow’s graphs guide makes the same kind of claim for tf.function: graphs “tend to offer better performance,” and its toy example takes 4.10 seconds eagerly against 0.80 seconds as a graph. Each of these compares a framework with itself, eager against compiled.

Both guides also warn about the cost of the first steps. TensorFlow says “the first few steps of any large model training can be slower due to tracing,” and compiled PyTorch pays a similar one-time compile cost. Any benchmark that includes those steps measures startup, not training speed.

Try this yourself: time your own model on your own hardware.

  1. Fix the model, batch size, numeric precision and data pipeline, so only the framework changes.
  2. Run 20 warm-up steps, which absorb compilation and tracing, and do not time them.
  3. Time the next 200 training steps and repeat the run three times.
  4. Compare the median steps per second, first eager against compiled inside one framework, then across frameworks.

Turning compilation on in PyTorch is one line:

compiled_model = torch.compile(model)

Ecosystem, Codebase, and a Hedge

The ecosystem decides most projects. The framework fixes which pretrained models load without friction, which tutorials match your errors, and which libraries you can add. The Hugging Face change above is the clearest case: a new project built on Transformers v5 is a PyTorch project.

An existing codebase beats a trend. If 50,000 lines of TensorFlow already run in production, a new PyTorch project means two stacks, two deployment pipelines and two sets of monitoring. Stay on TensorFlow unless the ecosystem point above blocks you, and “PyTorch is more popular” does not count as blocking. The deployment table also shows that training in one framework and shipping through the other’s runtime is documented: LiteRT exports from PyTorch, and ONNX Runtime Web takes models converted from PyTorch or TensorFlow.

Eager versus graph is a footnote now. TensorFlow runs operations eagerly and builds graphs with tf.function. PyTorch runs eagerly and compiles with torch.compile. The old philosophical split has become a switch you flip per model.

Keras 3 is the hedge if you cannot commit. Its getting-started page says you install a backend of JAX, TensorFlow or PyTorch next to Keras and pick it with the KERAS_BACKEND variable or the ~/.keras/keras.json file. The backend must be set before importing Keras and cannot be changed afterwards:

import os
os.environ["KERAS_BACKEND"] = "jax"  # or "tensorflow" or "torch"
import keras

Before you commit, spend one hour on the check that settles it: load the pretrained model you most expect to use, run one training epoch on a slice of your own data in the framework you lean toward, and note anything that blocks you. A blocker found today costs an hour. Found after the architecture is chosen, it costs much more.

Which Framework Should You Pick?
Pick PyTorch if you are…
Starting fresh, with no TensorFlow code to keep
Fine-tuning with Hugging Face Transformers v5
Training or serving LLMs with vLLM or DeepSpeed (PyTorch Foundation projects)
Shipping to phones or microcontrollers with ExecuTorch
Running browser inference through an ONNX export
Pick TensorFlow if you are…
Maintaining a TensorFlow codebase that works
Running Python TensorFlow models in browsers with TensorFlow.js
Already serving through TensorFlow Serving
Converting a TensorFlow model to LiteRT for Android or iOS
If you cannot commit yet, see the Keras 3 note near the end.

Frequently Asked Questions

Should I learn both TensorFlow and PyTorch?

Learn one well first. The concepts transfer (tensors, automatic differentiation, layers, optimizers, loss functions), and Keras 3 lets one API sit on top of either framework, so the second one costs far less than the first. Start with PyTorch if you are a student, a researcher or starting a project. Start with TensorFlow if your employer’s code runs on it or your target is TensorFlow.js.

Is TensorFlow dying?

The evidence says narrowing, not dying. TensorFlow 2.21.0 shipped on March 6 and a 2.22.0 release candidate followed on September 24, and the TensorFlow Serving and TensorFlow.js pages carry no end-of-life notice. Against that, tf.lite is slated for deprecation in favor of the LiteRT repository, TensorBoard is no longer bundled, and Hugging Face says Transformers v5 is sunsetting TensorFlow support. Judge it by the release page for the version you plan to pin, not by headlines.

What about JAX?

The JAX docs call it “a Python library for accelerator-oriented array computation and program transformation,” built around jax.jit, jax.grad and jax.vmap, running on CPU, GPU and TPU. Its ecosystem list names Flax, Equinox and Keras for neural networks. Choose it when you want composable function transformations or a TPU-first workflow. Hugging Face says it is working with JAX ecosystem partners on compatibility with Transformers v5.

Can I use a GPU with TensorFlow on Windows?

Not natively. TensorFlow’s install page says 2.10 was the last release with native Windows GPU support. From 2.11 on, install TensorFlow inside WSL2 for GPU training, or use the CPU build on native Windows. Check that page for the current driver and CUDA requirements before you install, because the versions it lists change with each release.

Leave a comment