tf.transpose
provides the same functionality as np.swapaxes
, although in a more generalized form. In your case, you can do tf.transpose(orig_tensor, [1, 0, 2])
which would be equivalent to np.swapaxes(orig_np_array, 0, 1)
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…