How do you transpose tensors?
Solution 1:
The operation of taking a transpose is closely related to the concept of symmetry. One paper that addresses this is http://www.iaeng.org/publication/WCE2010/WCE2010_pp1838-1841.pdf. I have been researching $2^m$ dimensional matrices where the indices are zeros and ones. The transpose is found by changing all zeros to ones and ones to zeros.
Solution 2:
Here is an example for 3D array,
First decide if it's row major (e.g. C) or column major (e.g. Fortran).
For a C array A[n3][n2][n1], the fastest dimension is n1, and we can name this original sequence as 321.
Then we can say we want a 321 -> 132 transpose operation, which is to copy the array element A[i3][i2][i1] to B[i1][i3][i2].
Often we assume from fastest dimension to slowest dimension being 123, then we can call the above transpose operation as 231 (i.e., 123->231).