Theano/Theano — Issue #222: Write a custom Op with C code for 'roll'
Author: dwf
Created: 2011-11-23 21:12:45+00:00
State: open
Labels: Enhancement, Nice-To-Have

There's a simple implementation mimicking `numpy.roll` contributed by @mrocklin in pull request #221. However, it uses subtensors and Join, and could probably be sped up quite a bit by writing a custom Op with C code.

This would be a pretty easy task for someone who wanted to become familiar with writing Ops, as it doesn't involve any particularly complicated logic, just permuting things and doing the inverse permutation for the gradient.

All the better if it has a flag that can operate in-place (obviously you need a temporary buffer the size of a single element on the roll axis; @nouiz may have some insight on the most efficient way to do this cache-wise)