Issue1914

issue #1914, Adding advanced indexing to theano
This helper function should not be a method of `Tensor`, it should be defined outside, without the `self`.