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

Function gelu_impl

SwissArmyTransformer/sat/model/official/chatglm_model.py:11–14  ·  view source on GitHub ↗

OpenAI's gelu implementation.

(x)

Source from the content-addressed store, hash-verified

9
10@torch.jit.script
11def gelu_impl(x):
12 """OpenAI's gelu implementation."""
13 return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x *
14 (1.0 + 0.044715 * x * x)))
15
16def gelu(x):
17 return gelu_impl(x)

Callers 1

geluFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected