mlx_rs::nn

Function gelu

Source
pub fn gelu(x: impl AsRef<Array>) -> Result<Array>
Expand description

Applies the Gaussian Error Linear Units function.

This is:

x * (1 + erf(x / 2.sqrt())) / 2