It seems to work for me, at least with the dev version:
>>> x = T.ftensor4('x')
>>> y = x[:,(1,0,2),:,::-1]
>>> xv = np.random.rand(2, 3, 2, 2)
>>> np.allclose(y.eval({x: xv}), xv[:,(1,0,2),:,::-1])
I tried with a couple of other shapes and it worked.
On Wed, Nov 02, 2016, David Knowles wrote:
> If I have a 4-tensor
> x=T.ftensor4('x')
> and I want x[:,(1,0,2),:,::-1], i.e. a re-ordering of dimension 2 and
> reversal of dim 4 it seems (unlike in numpy) I have to do this in two
> steps e.g. x[:,(1,0,2),:,:][:,:,:,::-1].
>
> Is this expected?
>
> Thanks
>
> --
> David A. Knowles,
> Stanford University.
> E-mail: [email protected]
> Web: http://cs.stanford.edu/~davidknowles/
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
--
Pascal
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.