Static graphs in a world gone eager
PyTensor gives PyMC a hackable, pure-Python engine for compiling symbolic array math to C, JAX, or Numba.

What it does
PyTensor is a symbolic mathematics library for multi-dimensional arrays. You define expressions as a static, mutable graph; it then optimizes that graph—folding constants, eliminating dead operations, and substituting BLAS calls—before compiling to C, JAX, or Numba. It is the current computational backend for PyMC, the Bayesian modeling library.
The interesting bit
In an era where PyTorch and TensorFlow chased eager execution, PyTensor deliberately preserves the old Theano philosophy: a static graph that can be modified in-place. That anachronism is the point—advanced optimizations are easier when you can rewrite the whole program before running it.
Key highlights
- Pure-Python codebase described as “hackable” and extensible
- Graph transpilation framework targets C, JAX, and Numba backends
- Static computation graph supports in-place symbolic optimizations
- Direct lineage from Theano via Aesara
- Serves as the computational engine for PyMC
Verdict
Grab it if you are building Bayesian models in PyMC or need optimizable symbolic computation with backend flexibility. Look elsewhere if you want an eager, general-purpose deep-learning framework.
Frequently asked
- What is pymc-devs/pytensor?
- PyTensor gives PyMC a hackable, pure-Python engine for compiling symbolic array math to C, JAX, or Numba.
- Is pytensor open source?
- Yes — pymc-devs/pytensor is an open-source project tracked on heatdrop.
- What language is pytensor written in?
- pymc-devs/pytensor is primarily written in Python.
- How popular is pytensor?
- pymc-devs/pytensor has 631 stars on GitHub.
- Where can I find pytensor?
- pymc-devs/pytensor is on GitHub at https://github.com/pymc-devs/pytensor.