<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#L309-L340) |

Sigmoid Linear Unit (SiLU) activation function, also known as Swish.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.silu(
        x
    )

The SiLU activation function is computed by the sigmoid function multiplied
by its input. It is defined as `f(x) = x * sigmoid(x)`.

<br />

<br />

<br />

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

<br />

<br />

<br />

<br />

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

<br />

#### Example:

    x = keras.ops.convert_to_tensor([-6.0, 1.0, 0.0, 1.0, 6.0])
    keras.ops.sigmoid(x)
    array([0.00247262, 0.7310586, 0.5, 0.7310586, 0.9975274], dtype=float32)
    keras.ops.silu(x)
    array([-0.0148357, 0.7310586, 0.0, 0.7310586, 5.9851646], dtype=float32)