ivy.swapaxes(x: ivy.NativeArray, axis0: int, axis1: int, f: Optional[ivy.Framework] = None) → ivy.NativeArray[source]

Interchange two axes of an array.

  • x (array) – Input array.

  • axis0 (int) – First axis to be swapped.

  • axis1 (int) – Second axis to be swapped.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.


x with its axes permuted.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty