<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/activations/activations.py#L337-L357) |

Gaussian error linear unit (GELU) activation function.

    tf.keras.activations.gelu(
        x, approximate=False
    )

The Gaussian error linear unit (GELU) is defined as:

`gelu(x) = x * P(X <= x)` where `P(X) ~ N(0, 1)`,
i.e. `gelu(x) = 0.5 * x * (1 + erf(x / sqrt(2)))`.

GELU weights inputs by their value, rather than gating
inputs by their sign as in ReLU.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `approximate` | A `bool`, whether to enable approximation. |

<br />

#### Reference:

- [Hendrycks et al., 2016](https://arxiv.org/abs/1606.08415)