ivy.flip(x: ivy.NativeArray, axis: Optional[int] = None, batch_shape: Optional[List[int]] = None, f: Optional[ivy.Framework] = None) → ivy.NativeArray[source]

Reverses the ord of elements in an array along the given axis. The shape of the array is preserved, but the elements are reordered.

  • x (array) – Input array.

  • axis (None or int or sequence of ints, optional) – Axis or axes along which to flip over. The default, axis: int = None, will flip over all axes.

  • batch_shape (sequence of ints, optional) – Shape of batch. Inferred from inputs if None.

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


An array with the entries of axis reversed.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty