<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/numpy.py#L3533-L3549) |

Reverse the order of elements in the tensor along the given axis.

#### View aliases


**Main aliases**

[`tf.keras.ops.numpy.flip`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/flip)

<br />

    tf.keras.ops.flip(
        x, axis=None
    )

The shape of the tensor is preserved, but the elements are reordered.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `axis` | Axis or axes along which to flip the tensor. The default, `axis=None`, will flip over all of the axes of the input tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Output tensor with entries of `axis` reversed. ||

<br />