# mlx.core.swapaxes — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.core.swapaxes

mlx.core.swapaxes(a: array, /, axis1: int, axis2: int, *, stream: Union[ 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