Deep Learning

PyTensor – Python library that integrates with NumPy

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
TensorFlowA very popular Deep Learning framework
PyTorchTensors and Dynamic neural networks in Python
KerasHigh-level neural networks API
fastaiSimplifies training fast and accurate neural nets using modern best practices
PyTensorLibrary for fast numerical computation
ElephasDistributed deep learning with Keras and Spark
ChainerPowerful, flexible, and intuitive framework for neural networks
CaffeConvolutional Architecture for Fast Feature Embedding
TFlearnDeep learning library featuring a higher-level API for TensorFlow
MXNetFlexible and efficient library
CNTKDistributed deep learning
NeupyPython library for Artificial Neural Networks and Deep Learning

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments