MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / gelu_impl

Function gelu_impl

codegeex/megatron/model/utils.py:62–66  ·  view source on GitHub ↗

OpenAI's gelu implementation.

(x)

Source from the content-addressed store, hash-verified

60
61@torch.jit.script
62def gelu_impl(x):
63 """OpenAI's gelu implementation."""
64 return (
65 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x * (1.0 + 0.044715 * x * x)))
66 )
67
68
69def openai_gelu(x):

Callers 1

openai_geluFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected