PyTensor is a Python library that allows you to define, optimize/rewrite, and evaluate mathematical expressions involving multi-dimensional arrays efficiently.
Some of PyTensor’s features are:
Tight integration with NumPy - Use
numpy.ndarrayin 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
xis near zero
Dynamic C/JAX/Numba code generation - Evaluate expressions faster
PyTensor is based on Theano, which has been powering large-scale computationally intensive scientific investigations since 2007.
Much of the documentation hasn’t been updated and is simply the old Theano documentation.
PyTensor is available on PyPI, and can be installed via
pip install PyTensor.
Those interested in bleeding-edge features should obtain the latest development version, available via:
git clone git://github.com/pymc-devs/pytensor.git
You can then place the checkout directory on your
$PYTHONPATH or use
python setup.py develop to install a
.pth into your
directory, so that when you pull updates via Git, they will be
automatically reflected the “installed” version. For more information about
installation and configuration, see installing PyTensor.
Roughly in order of what you’ll want to check out:
Installing PyTensor – How to install PyTensor.
Getting Started – What is PyTensor?
Tutorial – Learn the basics.
Troubleshooting – Tips and tricks for common debugging.
API Documentation – PyTensor’s functionality, module by module.
Frequently Asked Questions – A set of commonly asked questions.
Optimizations – Guide to PyTensor’s graph optimizations.
Extending PyTensor – Learn to add a Type, Op, or graph optimization.
Developer Start Guide – How to contribute code to PyTensor.
Internal Documentation – How to maintain PyTensor and more…
Acknowledgements – What we took from other projects.
Related Projects – link to other projects that implement new functionalities on top of PyTensor
Visit pytensor-users to discuss the general use of PyTensor with developers and other users