Skip to main content

from_gelu

Function from_gelu 

Source
pub fn from_gelu(
    spec: &GeluSpec,
    names: &StageNames,
    shape: (usize, usize),
    target: &SpatialTarget,
) -> Result<SpatialProgram, SpatialReject>
Expand description

y = gelu(x) — ggml’s tanh approximation in its one-exponential form x / (1 + e^-2z) with z = √(2/π)·(x + 0.044715·x³), exactly as the parser desugars it (same arrangement, same tails).