Extending Theano¶
This advanced tutorial is for users who want to extend Theano with new Types, new Operations (Ops), and new graph optimizations.
Along the way, it also introduces many aspects of how Theano works, so it is also good for you if you are interested in getting more under the hood with Theano itself.
Before tackling this more advanced presentation, it is highly recommended to read the introductory Tutorial.
The first few pages will walk you through the definition of a new Type,
double
, and a basic arithmetic operations on that Type. We
will start by defining them using a Python implementation and then we will add
a C implementation.
- Writing an Op to work on an
ndarray
in C - Overview of the compilation pipeline
- Theano vs. C
- Graph Structures
- Making the double type
- Making arithmetic Ops on double
- Views and inplace operations
- Implementing some specific Ops
- Implementing double in C
- Implementing the arithmetic Ops in C
- Using Op params
- Graph optimization
- Tips
- Unit Testing
- Extending Theano: FAQ and Troubleshooting