Theano/Theano — pull request #223 by dwf (2011-11-23 22:17:11+00:00)
Title: Fix default axis for tensor.roll

#221 introduced a convenience function that emulates `numpy.roll` (thanks, @mrocklin) with subtensors and joins, however the default `axis` argument was 0, which deviates from the NumPy behaviour. The default behaviour of NumPy is to first flatten, roll on axis 0 and then reshape back to the original dimensions.

Seeing as deviations from NumPy's behaviour should probably only happen for a very good reason (e.g. casting madness, Theano's desire to be strongly typed), this pull request brings the behaviour into full lock-step with NumPy by flatten, a recursive call to roll, followed by a reshape. It also adds a test for this case.