How to permutate tranposition in tensorflow?
I think perm
is permuting the dimensions. For example perm=[0,2,1]
is short for dim_0 -> dim_0, dim_1 -> dim_2, dim_2 -> dim_1
. So for a 2D tensor, perm=[1,0]
is just matrix transpose. Does this answer your question?
A=[2,3,4] matrix, using perm(1,0,2) will get B=[3,2,4].
Explanation:
Index=(0,1,2)A =[2,3,4]Perm =(1,0,2)B =(3,2,4) --> Perm 1 from Index 1 (3), Perm 0 from Index 0 (2), Perm 2 from Index 2 (4) --> so get (3,2,4)