<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/nn.py#L34-L54) |

Rectified linear unit activation function.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.relu(
        x
    )

It is defined as `f(x) = max(0, x)`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor with the same shape as `x`. ||

<br />

#### Example:

    x1 = keras.ops.convert_to_tensor([-1.0, 0.0, 1.0, 0.2])
    keras.ops.relu(x1)
    array([0.0, 0.0, 1.0, 0.2], dtype=float32)