I want to re-order elements in 3d lists/tensor3 such that: (python version)

x_d = [[[1,0,0,0],[0,11,0,0],[0,0,111,0]],[[2,0,0,0],[0,22,0,0],[0,0,222,0
]],[[3,0,0,0],[0,33,0,0],[0,0,333,0]]]


print(zip(*x_d))


[([1, 0, 0, 0], [2, 0, 0, 0], [3, 0, 0, 0]), ([0, 11, 0, 0], [0, 22, 0, 0], 
[0, 33, 0, 0]), ([0, 0, 111, 0], [0, 0, 222, 0], [0, 0, 333, 0])]



How can I achieve the same behavior in Theano ?



import theano
import theano.tensor as T


x = T.tensor3('x')
f = theano.function([x], ?)
x_d = [[[1,0,0,0],[0,11,0,0],[0,0,111,0]],[[2,0,0,0],[0,22,0,0],[0,0,222,0
]],[[3,0,0,0],[0,33,0,0],[0,0,333,0]]]
print(f(x_d))


Thanks !

-- 

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