I have a tensor of shape (30,116,10) and I want to swap the first two dimesions, so that I have a tensor of shape (116,30,10)
I saw that numpy as such a function implemented (np.swapaxes) and I searched for something similar in tensorflow but I found nothing.
Do you have any idea ?
Thanks in advance,
Alexis
tf.transpose
provides the same functionality asnp.swapaxes
, although in a more generalized form. In your case, you can dotf.transpose(orig_tensor, [1, 0, 2])
which would be equivalent tonp.swapaxes(orig_np_array, 0, 1)
.