def gelu_d
import bendtorch@1.3.0.0/main.bend as Bendtorchimport Base
1101def gelu_d(+dy: F32, +x: F32) -> F32:
1102 +th = F32.tanh(gelu_inner(x))
1103 +left = (0.5 * x : F32)
1104 +dleft = (0.5 * (1.0 + th : F32) : F32)
1105 +dright = ((left * (1.0 - (th * th : F32) : F32) : F32) * (0.7978845608028654 * (1.0 + ((3.0 * 0.044715 : F32) * (x * x : F32) : F32) : F32) : F32) : F32)
1106 (dy * (dleft + dright : F32) : F32)