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

Function fast_gelu

codegeex/torch/codegeex_model.py:7–9  ·  view source on GitHub ↗

Mindspore's fast gelu implementation.

(x)

Source from the content-addressed store, hash-verified

5
6
7def fast_gelu(x):
8 """Mindspore's fast gelu implementation."""
9 return x / (1 + torch.exp(-1.702 * torch.abs(x))) * torch.exp(0.851 * (x - torch.abs(x)))
10
11
12class MLP(torch.nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected