IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

silu

silu[dtype: DType, width: Int](x: SIMD[dtype, width]) -> SIMD[dtype, width] where dtype.is_floating_point()

Sigmoid Linear Unit (SiLU) activation function.

Computes x * sigmoid(x) = x / (1 + exp(-x)).

Constraints:

The dtype must be a floating-point type.

Args:

Returns:

SIMD[dtype, width]: SiLU activation applied element-wise.