def F32.gelu
import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensorsimport Base
1817# gelu, the tanh form: 0.5 x (1 + tanh(sqrt(2 / pi) (x + 0.044715 x^3)))
1818def F32.gelu(x0: F32) -> F32:
1819 +x = x0
1820 (0.5 * x * (1.0 + F32.tanh((0.7978845608 * (x + 0.044715 * x * x * x : F32) : F32))) : F32)