latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.swapaxes
- tensorplay.functional.swapaxes(input, axis0, axis1) Tensor[source]
Alias for
tensorplay.transpose().This function is equivalent to NumPy’s swapaxes function.
Examples:
>>> x = tensorplay.tensor([[[0,1],[2,3]],[[4,5],[6,7]]]) >>> x tensor([[[0, 1], [2, 3]], [[4, 5], [6, 7]]]) >>> tensorplay.swapaxes(x, 0, 1) tensor([[[0, 1], [4, 5]], [[2, 3], [6, 7]]]) >>> tensorplay.swapaxes(x, 0, 2) tensor([[[0, 4], [2, 6]], [[1, 5], [3, 7]]])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

