mlx.core.flip

Contents

mlx.core.flip#

flip(a: array, /, axis: None | int | Sequence[int] = None, *, stream: None | Stream | Device = None) array#

Reverse the order of elements along the given axis.

Parameters:
  • a (array) – Input array.

  • axis (int or tuple(int), optional) – Axis or axes to flip over. Defaults to None in which case all axes are flipped.

Returns:

The flipped array.

Return type:

array