WLJS LogoWLJS Notebook

TensorTranspose

TensorTranspose[tensor, perm] represents the tensor obtained by transposing the slots of tensor as given by the permutation perm.

Examples

Transpose a 3-dimensional tensor:

t = Array[Subscript[a, ##] &, {2, 3, 4}];
TensorTranspose[t, {3, 1, 2}] // Dimensions
(* {4, 2, 3} *)

Simple matrix transpose:

TensorTranspose[{{1, 2}, {3, 4}}, {2, 1}]
(* {{1, 3}, {2, 4}} *)

Please visit the official Wolfram Language Reference for more details.

On this page