mlx.core.swapaxes

Contents

mlx.core.swapaxes#

swapaxes(a: array, /, axis1: int, axis2: int, *, stream: None | Stream | Device = None) array#

Swap two axes of an array.

Parameters:
  • a (array) – Input array.

  • axis1 (int) – Specifies the first axis.

  • axis2 (int) – Specifies the second axis.

Returns:

The array with swapped axes.

Return type:

array