Python wrappers
Public Python APIs implemented by this engine symbol.Autograd node for the tanh-approximation GeLU .
The approximate form (Hendrycks & Gimpel 2016, eq. 3) is used by default
when callers do not request the exact erf-based variant; it is the form
implemented by F.gelu(x, approximate="tanh") in the Python wrapper.
The backward is delegated to the backend because the analytic derivative
involves both tanh and sech^2 over a cubic polynomial of , and
fusing them in a single kernel is materially faster than chaining storage
primitives.
Math
References
Hendrycks & Gimpel, "Gaussian Error Linear Units (GELUs)", arXiv:1606.08415.
Attributes
schema_v1OpSchema"gelu", AmpPolicy::ForceFP32 — the cubic + tanh chain is not numerically safe in float16.