MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / gelu_impl

Function gelu_impl

SwissArmyTransformer/sat/mpu/utils.py:100–103  ·  view source on GitHub ↗

OpenAI's gelu implementation.

(x)

Source from the content-addressed store, hash-verified

98
99@torch.jit.script
100def gelu_impl(x):
101 """OpenAI's gelu implementation."""
102 return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x *
103 (1.0 + 0.044715 * x * x)))
104
105def gelu(x):
106 return gelu_impl(x)

Callers 1

geluFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected