https://github.com/Theano/Theano/pull/1827