MCPcopy Create free account
hub / github.com/THUDM/GLM / gelu_impl

Function gelu_impl

mpu/transformer.py:333–336  ·  view source on GitHub ↗

OpenAI's gelu implementation.

(x)

Source from the content-addressed store, hash-verified

331
332@torch.jit.script
333def gelu_impl(x):
334 """OpenAI's gelu implementation."""
335 return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x *
336 (1.0 + 0.044715 * x * x)))
337
338
339def gelu(x):

Callers 1

geluFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected