mlx.nn.gelu#

mlx.nn.gelu(x) array#

Applies the Gaussian Error Linear Units function.

\[\textrm{GELU}(x) = x * \Phi(x)\]

where \(\Phi(x)\) is the Gaussian CDF.

See also gelu_approx() and gelu_fast_approx() for faster approximations.