<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#L7367-L7385) |

Roll tensor elements along a given axis.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.roll(
        x, shift, axis=None
    )

Elements that roll beyond the last position are re-introduced at the first.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `shift` | The number of places by which elements are shifted. |
| `axis` | The axis along which elements are shifted. By default, the array is flattened before shifting, after which the original shape is restored. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Output tensor. ||

<br />