I need to create a 3D tensor like this (5,3,2) for example
array([[[0, 0],
[0, 1],
[0, 0]],
[[1, 0],
[0, 0],
[0, 0]],
[[0, 0],
[1, 0],
[0, 0]],
[[0, 0],
[0, 0],
[1, 0]],
[[0, 0],
[0, 1],
[0, 0]]])
There should be exactly one 'one' placed randomly in every slice (if you consider the tensor to be a loaf of bread). This could be done using loops, but I want to vectorize this part.