MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / gelu_impl

Function gelu_impl

DeepSpeedExample/megatron/model/utils.py:52–55  ·  view source on GitHub ↗

OpenAI's gelu implementation.

(x)

Source from the content-addressed store, hash-verified

50
51@torch.jit.script
52def gelu_impl(x):
53 """OpenAI's gelu implementation."""
54 return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x *
55 (1.0 + 0.044715 * x * x)))
56def openai_gelu(x):
57 return gelu_impl(x)
58

Callers 1

openai_geluFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected