Skip to content
30 November 2026 An independent technology publication
Explainer

PyTorch vs TensorFlow in 2027: 7 honest differences that decide it

PyTorch vs TensorFlow for 2027: release data, Google's maintenance shift, Keras 3, JAX, deployment and jobs, with a clear verdict, charts and a decision guide.

PyTorch vs TensorFlow in 2027: 7 honest differences that decide it, DevQuarry featured image

PyTorch vs TensorFlow used to be a close call. Going into 2027 it is not. PyTorch is where new deep learning work happens: it shipped eight releases in 2026, it is the only backend of Hugging Face Transformers v5, and Google itself now recommends Keras 3, JAX or PyTorch for new generative AI projects. TensorFlow still runs a lot of production systems and its mobile runtime, now called LiteRT, is very much alive, but the core framework has moved to a maintenance footing.

That does not make TensorFlow worthless, and it does not mean every team should migrate tomorrow. This comparison looks at seven differences that matter when you choose, with release data I pulled from PyPI and commit history I counted from each project’s Git repository. It ends with a decision guide for each kind of reader.

PyTorch vs TensorFlow in 2027 comparison, DevQuarry featured image

Key takeaways

  • For new projects in 2027, choose PyTorch unless you have a specific reason not to.
  • In March 2026 Google said TensorFlow will focus on security fixes, critical bugs and dependency updates, and pointed new generative AI work to Keras 3, JAX and PyTorch.
  • PyTorch published eight releases in 2026 up to version 2.15. TensorFlow published one, version 2.21.
  • Hugging Face Transformers v5 (December 2025) uses PyTorch as its sole backend and is sunsetting TensorFlow and Flax support.
  • TensorFlow still makes sense for existing TF systems, TF Serving and TFX pipelines. For on-device inference, LiteRT now converts PyTorch and JAX models too.

PyTorch vs TensorFlow: the short answer

For learning, research or anything built around large language models, use PyTorch. Teams with a working TensorFlow system do not need to rewrite it, but should plan new components with the move in mind. And if you like the Keras API, use Keras 3, which runs on top of PyTorch, JAX or TensorFlow.

You are…ChooseMain reason 
Learning deep learning in 2027PyTorchmost courses and open models use it
Doing researchPyTorch (or JAX)fastest moving, nearly all new code releases
Building on open LLMsPyTorchHugging Face Transformers v5 is PyTorch-only
Maintaining a TensorFlow production systemstay, plan graduallyTF still gets security and critical fixes
Shipping models to phones and edge devicesLiteRT, with any frameworkLiteRT converts PyTorch and JAX models
Training at very large scale on TPUsJAXGoogle’s own large models and tooling centre on it
Wanting a high-level API with backend choiceKeras 3one code base, three backends

A short history of PyTorch vs TensorFlow

YearPyTorchTensorFlow and Google 
2015TensorFlow open-sourced by Google
2016PyTorch released by Facebook AI Research
2018JAX released
2019TensorFlow 2.0 adopts eager execution and Keras as its main API
2022PyTorch moves to the Linux Foundation’s new PyTorch Foundation
2023PyTorch 2.0 introduces torch.compileKeras 3 launches with JAX, PyTorch and TensorFlow backends
2025Hugging Face Transformers v5 goes PyTorch-only
2026releases every two months, 2.10 to 2.15TensorFlow 2.21 and a shift to maintenance; TF Lite becomes LiteRT

TensorFlow came first and dominated early industry use. It was built around static computation graphs, which made deployment efficient but debugging painful. PyTorch arrived with “define by run” eager execution: the model is ordinary Python code, so you can print values and step through it in a debugger. Researchers moved to it quickly, and the models they published pulled practitioners along.

TensorFlow 2.0 in 2019 adopted eager execution and Keras to close the gap, but by then the research community had settled on PyTorch. In September 2022, Meta moved PyTorch to the PyTorch Foundation under the Linux Foundation, with AMD, AWS, Google Cloud, Meta, Microsoft Azure and NVIDIA as founding members.

Difference 1: where each framework is heading

On 6 March 2026, Google published What’s new in TensorFlow 2.21. Alongside the release notes, it said that going forward the team “will exclusively focus on” three things:

  • security and critical bug fixes
  • dependency updates, including new Python releases
  • review of critical community bug fixes

That commitment covers TensorFlow and its ecosystem libraries, from tf.data and TensorFlow Serving to TFX and TensorBoard. For new work in generative AI, the post recommends “exploring our latest updates for Keras 3, JAX, and PyTorch.”

PyTorch went the other way in 2026. Its 2.10 release notes announced a faster cadence: one release every two months instead of one a quarter. The project delivered on it.

SignalPyTorchTensorFlow 
Stated directionactive feature developmentsecurity, critical fixes, dependency updates
Release cadence in 2026every two monthsone feature release (2.21, March 2026)
Latest version (November 2026)2.15.0, 28 October 20262.21.0, 6 March 2026
GovernancePyTorch Foundation (Linux Foundation)Google
Recommended by Google for new GenAI workyes, alongside Keras 3 and JAXnot named

Difference 2: PyTorch vs TensorFlow release activity

PyTorch vs TensorFlow releases per year from PyPI

I pulled every final release of each package from the PyPI JSON API and counted them by year. Pre-releases are excluded; patch releases are included.

Package20222023202420252026 (to November) 
torch (PyTorch)65968
tensorflow209641
jax3022151313
keras47161110

TensorFlow’s count has fallen every year, from 20 releases in 2022 (many of them patch releases across several supported versions) to a single release in 2026. PyTorch published 2.10, 2.11, 2.12, 2.13, 2.14 and 2.15 in 2026, plus two patch releases.

Release counts are a rough signal. A mature library could ship rarely and still be healthy. Combined with Google’s own statement, though, they point the same way.

What the commit history shows (and does not)

I also counted commits in each repository from November 2024 to October 2026, excluding automated accounts such as merge bots and internal sync accounts.

RepositoryHuman commits, Nov 2024 to Oct 2025Nov 2025 to Oct 2026Distinct human authors (last 12 months) 
pytorch/pytorch13,41215,9731,656
tensorflow/tensorflow9,00711,342754
jax-ml/jax5,3445,899336
keras-team/keras6701,170180

The TensorFlow number needs a warning. Its repository also hosts shared compiler and runtime code, including XLA, which JAX and other projects depend on. In the last 12 months, 41% of TensorFlow’s human commits had XLA, HLO, GPU, MLIR or related terms in their subject line. A busy TensorFlow repository does not mean busy development of the TensorFlow Python API. PyTorch’s own counts include its compiler stack too, but that work serves PyTorch users directly.

Difference 3: the PyTorch vs TensorFlow ecosystem gap

The ecosystem decides how much you build yourself. Most open models now arrive as PyTorch code and weights.

The clearest signal came in December 2025, when Hugging Face released Transformers v5 and said it was “sunsetting our Flax/TensorFlow support in favor of focusing on PyTorch as the sole backend.” Transformers is the library most people use to load open models, with over 400 model architectures and more than 750,000 compatible checkpoints on the Hugging Face Hub, according to that post.

PyTorch vs TensorFlow ecosystem map: training, compilation, export, serving and on-device tools
StagePyTorch ecosystemTensorFlow ecosystem 
Models and librariesHugging Face Transformers, Diffusers, timm, torchvisionKeras applications, TF Hub (legacy), Keras Hub
Training at scaleFSDP, DeepSpeed, Megatron-style librariestf.distribute, TPU support
Compilationtorch.compile, torch.exportXLA (also used by JAX)
ServingvLLM, SGLang, NVIDIA TritonTensorFlow Serving
Pipelinesmany general MLOps toolsTFX
On-deviceExecuTorch, LiteRT conversionLiteRT (formerly TF Lite), TensorFlow.js

Large language model serving in particular has consolidated on PyTorch-based engines. If your project involves fine-tuning or serving an open LLM, the tools you will reach for assume PyTorch.

Difference 4: how the code feels

PyTorch vs TensorFlow training code side by side

The image above puts the same small classifier side by side: a PyTorch training loop and a Keras model with fit(). Neither needs much code. The difference is style.

  • PyTorch is explicit. You write the training loop: forward pass, loss, backward pass, optimiser step. It takes a little more code, and nothing is hidden.
  • Keras is declarative. You describe the model and call fit(). It is shorter for standard problems and hides the loop unless you override it.
  • Debugging feels similar now that both run eagerly by default, but PyTorch errors usually point straight at your own Python line.
  • Compiling for speed: PyTorch adds torch.compile(model) as a one-line opt-in. TensorFlow uses tf.function and XLA, which can change behaviour in ways that surprise newcomers.

Since Keras 3, the Keras style no longer ties you to TensorFlow. The same Keras code can run on PyTorch by setting one environment variable before import:

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

import keras
model = keras.Sequential([keras.layers.Dense(64, activation="relu"), keras.layers.Dense(10)])

That makes “Keras vs PyTorch” a question of API taste, separate from “TensorFlow vs PyTorch”.

Difference 5: PyTorch vs TensorFlow in production

Deployment used to be TensorFlow’s strongest argument. TensorFlow Serving and TFX covered the server side, and TF Lite covered phones. That argument has weakened in three ways.

  1. PyTorch closed the gap. torch.export produces a portable graph of a model, and TorchScript, the older approach, was deprecated in PyTorch 2.10 in favour of it. ExecuTorch targets mobile and edge devices.
  2. On-device inference became framework-neutral. TF Lite is now LiteRT and is developed separately. Google describes it as converting models from PyTorch and JAX. Google reports LiteRT GPU performance 1.4 times faster than TF Lite, plus new NPU acceleration.
  3. LLM serving moved elsewhere. The engines people use to serve open language models are PyTorch-native.

TensorFlow Serving and TFX still work and still get security fixes. If your company runs them reliably today, they will keep running. The risk is long term: new hardware and new model types will arrive in PyTorch first.

Hardware support

PyTorch’s 2026 releases show how much of the hardware work now lands there first:

  • PyTorch 2.10 added Python 3.14 support for torch.compile and expanded Intel GPU support.
  • PyTorch 2.14 (September 2026) added Python 3.15 wheels, ROCm 7.14 builds for AMD GPUs, native graph capture on Intel XPU, faster linear algebra on Apple Silicon and compiler targets for NVIDIA’s Rubin generation, according to its release blog.
  • PyTorch 2.15 (October 2026) rewrote its NCCL backend to recover from failing GPUs in large training jobs, with 3,117 commits from 583 contributors, as DevClass reported.

TensorFlow keeps strong TPU support, but Google’s own large-scale TPU work increasingly runs through JAX.

Difference 6: learning resources and jobs

Learners should follow the materials. Most current courses and books teach PyTorch, often alongside Keras:

ResourceFramework 
Géron, Hands-On Machine Learning with Scikit-Learn and PyTorch (O’Reilly, October 2025)PyTorch (earlier editions used TensorFlow)
Chollet and Watson, Deep Learning with Python, third edition (Manning, September 2025)Keras 3, with JAX, PyTorch and TensorFlow primers
Karpathy, Neural Networks: Zero to HeroPyTorch
Hugging Face coursesPyTorch-first

Géron’s switch from TensorFlow to PyTorch in his long-running textbook is a good summary of where teaching has gone.

On jobs, I did not find a recent, well-sourced count of postings by framework, so I will not quote one. In practice, job descriptions for research and generative AI roles overwhelmingly mention PyTorch, while roles maintaining established recommendation, ranking or mobile systems still list TensorFlow. Knowing PyTorch well and being able to read TensorFlow code covers almost every case.

Difference 7: JAX, the third option

Any honest PyTorch vs TensorFlow comparison in 2027 has to mention JAX. JAX is Google’s array library with automatic differentiation and XLA compilation. It feels like NumPy with superpowers: you write pure functions and transform them with grad, jit and vmap.

PyTorchTensorFlowJAX 
Styleobject-oriented modules, eagerKeras models or low-level graphspure functions and transforms
Strengthecosystem, flexibility, LLM toolingmature production stack, legacy systemslarge-scale TPU training, research on new methods
Learning curvegentlemoderatesteeper (functional style)
Releases in 20268113
Best foralmost everyonemaintaining existing TF systemsteams on TPUs or with a functional bent

JAX shipped 13 releases in 2026 and is the main framework for Google’s own large models. It is a strong choice if you train on TPUs or want fine control over compilation. For most learners and most companies, PyTorch is still the easier default, and Keras 3 lets you try JAX without rewriting models.

Licences, governance and long-term risk

Both frameworks are free and open source, so licence cost is not the issue. Who steers each project, and how much risk that creates for a long-lived system, is.

PyTorchTensorFlowJAXKeras 3 
LicenceBSD-styleApache 2.0Apache 2.0Apache 2.0
StewardPyTorch Foundation (Linux Foundation)GoogleGoogleGoogle, as an open project
Funding basemany member companiesone companyone companyone company

PyTorch’s foundation model spreads control across hardware makers and cloud providers, which matters when you bet a product on a framework for five or more years. TensorFlow depends on Google’s priorities, and the March 2026 announcement shows those priorities have moved to JAX, Keras 3 and LiteRT.

For a team choosing in the PyTorch vs TensorFlow decision today, the practical risk is not that TensorFlow stops working. It is that new GPUs, new data types and new model architectures arrive late or not at all, and that hiring people who want to work on it gets harder over time.

PyTorch vs TensorFlow by use case

The general answer is PyTorch, but the details vary by field. Here is how the PyTorch vs TensorFlow choice plays out for common kinds of work in 2027.

Use caseDefault choiceNotes 
Large language models and chatPyTorchopen models, fine-tuning libraries and serving engines all assume it
Image generationPyTorchdiffusion and flow-matching libraries are PyTorch-first
Computer vision researchPyTorchmost new vision papers release PyTorch code
Classic vision in productioneitherexisting TensorFlow systems are fine to keep
Recommendation systemseithermany large TF systems exist; new builds lean PyTorch
Mobile and embeddedLiteRT or ExecuTorchtrain in any framework, convert for the device
Large-scale TPU trainingJAXTensorFlow is no longer Google’s focus here
Tabular dataoften neithergradient boosting usually beats deep learning on tables

The last row is worth repeating. For spreadsheet-style data, a gradient boosting library is often the better tool, as our XGBoost vs LightGBM vs CatBoost benchmark shows. The framework debate only matters once you have decided a neural network is the right model.

PyTorch vs TensorFlow performance: what matters

Benchmarks claiming one framework is faster than the other are common, and most are not worth much. Both call the same vendor libraries for the heavy maths on NVIDIA GPUs. What changes the speed of your training job is usually something else:

  1. Compilation. torch.compile in PyTorch and XLA in TensorFlow or JAX fuse operations and cut overhead. Turning compilation on often matters more than which framework you use.
  2. Precision. Training in 16-bit formats, and in 8-bit or 4-bit formats on new hardware, changes throughput far more than framework choice.
  3. The input pipeline. A slow data loader starves the GPU in either framework. Profile it before blaming the model.
  4. Batch size and memory use. Fitting a bigger batch, or using activation checkpointing, changes utilisation.
  5. Hardware support. New accelerators and data types usually get PyTorch support first, as the 2026 release notes show.

So the honest PyTorch vs TensorFlow speed answer is: comparable on equal settings, with PyTorch getting new hardware features sooner. Profile your own model before deciding anything on speed alone.

PyTorch vs TensorFlow migration: how to move in stages

If you maintain TensorFlow code and want to move, do it in stages rather than a big rewrite.

PyTorch vs TensorFlow decision guide for new and existing projects
  1. Freeze and document the current model, its preprocessing and a fixed evaluation set with expected outputs.
  2. Move high-level Keras code to Keras 3 first. Switch the backend to PyTorch and check the evaluation set gives matching results.
  3. Rewrite custom layers and training loops in PyTorch one component at a time, testing each against the TensorFlow output on the same inputs.
  4. Replace the data pipeline. tf.data code usually maps to a PyTorch Dataset and DataLoader, or to a framework-neutral loader.
  5. Choose the new serving path (torch.export, an inference server, or LiteRT for devices) and run both systems in parallel before switching traffic.
  6. Retire TensorFlow dependencies once nothing imports them.

Keep the old model as a reference until the new one matches it on your evaluation set. Small differences in default initialisation, padding or numerical precision can shift results, so compare the outputs themselves as well as the accuracy.

FAQ

Should I learn PyTorch or TensorFlow in 2027?

Learn PyTorch. It is what most courses and open models use, and Google itself recommends Keras 3, JAX or PyTorch for new generative AI work. Once you know PyTorch, reading TensorFlow code takes a few days.

Is TensorFlow being discontinued?

Google has not announced an end date. In March 2026 it said TensorFlow would focus exclusively on security and critical bug fixes, dependency updates such as new Python versions, and critical community fixes. That is maintenance mode: existing systems keep working, while Google’s new feature work goes to Keras 3 and JAX, plus LiteRT for devices.

Is PyTorch faster than TensorFlow?

Neither is faster across the board. With compilation enabled (torch.compile in PyTorch, XLA in TensorFlow or JAX), performance on common models is broadly comparable and depends on the model and hardware. Choose on ecosystem and support, then optimise.

Can I use Keras with PyTorch?

Yes. Keras 3 can use PyTorch as its backend, as well as JAX or TensorFlow. Set the KERAS_BACKEND environment variable to torch before importing Keras, and the same model code runs on PyTorch.

Which framework is better for mobile apps?

For on-device inference, use LiteRT (formerly TensorFlow Lite) or ExecuTorch. LiteRT now converts models from PyTorch and JAX as well as TensorFlow, so the training framework no longer locks you into a mobile runtime.

The verdict for 2027

The PyTorch vs TensorFlow question has an answer now. PyTorch is the default for new deep learning work, backed by a neutral foundation and the open-model ecosystem, with a release every two months. TensorFlow is a stable platform for systems already built on it, with security support but little new development, and its on-device runtime lives on as LiteRT. JAX is the specialist’s choice, and Keras 3 lets you keep a friendly API on top of whichever backend you pick.

To see what to learn after picking a framework, read the deep learning roadmap for 2027. To see PyTorch-era architectures in action, start with our transformer architecture guide.

About the author Aradhya Chaudhary

Data Scientist | Freelancer | Speaker & Writer skilled in programming, development and building AI/ML backed systems.

More from Aradhya
Keep reading

More in AI & ML

All of AI & ML →