Hopefully you found the answer already. But in case you didn't or someone
else have the same questions, it can be fine like this.

x[:,:,y]

This is called advanced indexing. Theano and NumPy support this.

Fred

Le 22 déc. 2016 10:17, "Quanty" <[email protected]> a écrit :

> Specifically, I have tensor x of shape (n1,n2,n3) and matrix y of shape
> (n1,n2). Each element in y is a iscalar between (0,n3-1). I hope to choose
> the element in x using y as the index, so that I can get a matrix of
> (n1,n2).
>
> --
>
> ---
> 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.
>

-- 

--- 
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.

Reply via email to