Tutorial#
Let us start an interactive session (e.g. with python
or ipython
) and import PyTensor.
>>> from pytensor import *
Several of the symbols you will need to use are in the tensor
subpackage
of PyTensor. Let us import that subpackage under a handy name like
at
(the tutorials will frequently use this convention).
>>> import pytensor.tensor as at
If that succeeded you are ready for the tutorial, otherwise check your installation (see Installing PyTensor).
Throughout the tutorial, bear in mind that there is a Glossary as well as index and modules links in the upper-right corner of each page to help you out.
Basics#
- Baby Steps - Algebra
- More Examples
- Derivatives in PyTensor
- Conditions
- Loop
- How Shape Information is Handled by PyTensor
- Broadcasting
Advanced#
Advanced configuration and debugging#
- Configuration Settings and Compiling Modes
- Printing/Drawing PyTensor graphs
- Debugging PyTensor: FAQ and Troubleshooting
- Isolating the Problem/Testing PyTensor Compiler
- Interpreting Error Messages
- Using Test Values
- “How do I print an intermediate value in a function?”
- “How do I print a graph (before or after compilation)?”
- “The function I compiled is too slow; what’s up?”
- “How do I step through a compiled function?”
- How to Use
pdb
- Dumping a Function to help debug
- Breakpoint during PyTensor function execution
- Dealing with NaNs
- Profiling PyTensor function