Last Updated on March 16, 2026
PyTensor is a Python library that allows one to define, optimize/rewrite, and evaluate mathematical expressions, especially ones involving multi-dimensional arrays (e.g. numpy.ndarrays). Using PyTensor, it is possible to attain speeds rivaling hand-crafted C implementations for problems involving large amounts of data.
PyTensor combines aspects of a computer algebra system (CAS) with aspects of an optimizing compiler. It can also generate customized code for multiple compiled languages and/or their Python-based interfaces, such as C, Numba, and JAX. This combination of CAS features with optimizing compilation and transpilation is particularly useful for tasks in which complicated mathematical expressions are evaluated repeatedly and evaluation speed is critical. For situations where many different expressions are each evaluated once, PyTensor can minimize the amount of compilation and analysis overhead, but still provide symbolic features such as automatic differentiation.
PyTensor is a fork of Aesara, which is a fork of Theano.
This is free and open source software.
Key Features
- Tight integration with NumPy – Use numpy.ndarray in PyTensor-compiled functions.
- Efficient symbolic differentiation – PyTensor efficiently computes your derivatives for functions with one or many inputs.
- Speed and stability optimizations – Get the right answer for log(1 + x) even when x is near zero.
- Dynamic C/JAX/Numba code generation – Evaluate expressions faster.
- Hackable, pure-Python codebase.
- Extensible graph framework suitable for rapid development of custom operators and symbolic optimizations.
- Implements an extensible graph transpilation framework that currently provides compilation via C, JAX, and Numba.
- Contrary to PyTorch and TensorFlow, PyTensor maintains a static graph which can be modified in-place to allow for advanced optimizations.
Website: pytensor.readthedocs.io
Support: GitHub code repository
Developer: PyMC Development team
License: 3-clause BSD license
PyTensor is written in Python. Learn Python with our recommended free books and free tutorials.
Related Software
| Deep Learning with Python | |
|---|---|
| TensorFlow | A very popular Deep Learning framework |
| PyTorch | Tensors and Dynamic neural networks in Python |
| Keras | High-level neural networks API |
| fastai | Simplifies training fast and accurate neural nets using modern best practices |
| PyTensor | Library for fast numerical computation |
| Elephas | Distributed deep learning with Keras and Spark |
| Chainer | Powerful, flexible, and intuitive framework for neural networks |
| Caffe | Convolutional Architecture for Fast Feature Embedding |
| TFlearn | Deep learning library featuring a higher-level API for TensorFlow |
| MXNet | Flexible and efficient library |
| CNTK | Distributed deep learning |
| Neupy | Python library for Artificial Neural Networks and Deep Learning |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

