Extending Theano
This advanced tutorial is for users who want to extend Theano with new Types,new Operations (Ops), and new graph optimizations. This first page of thetutorial mainly focuses on the Python implementation of an Op and thenproposes an overview of the most important methods that define an op.The second page of the tutorial (Extending Theano with a C Op) provides theninformation on the C implementation of an Op. The rest of the tutorialgoes more in depth on advanced topics related to Ops, such as how to writeefficient code for an Op and how to write an optimization to speed up theexecution of an Op.
Along the way, this tutorial also introduces many aspects of how Theano works,so it is also good for you if you are interested in getting more under the hoodwith Theano itself.
Note
Before tackling this more advanced presentation, it is highly recommendedto read the introductory Tutorial, especially the sectionsthat introduce the Theano Graphs, as providing a novel Theano op requires abasic understanting of the Theano Graphs.
See also the Developer Start Guide for information regarding theversioning framework, namely about git and GitHub, regarding thedevelopment workflow and how to make a quality contribution.
- Creating a new Op: Python implementation
- Extending Theano with a C Op
- 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
- Extending Theano with a GPU Op
- Graph optimization
- Tips
- Unit Testing
- Extending Theano: FAQ and Troubleshooting