MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / gelu

Function gelu

examples/tensorflow/bert/utils/bert.py:27–30  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

25SCALE_RESERVE_NUM = 21
26
27def gelu(x):
28 cdf = 0.5 * (1.0 + tf.tanh(
29 (np.sqrt(2 / np.pi) * (x + 0.044715 * tf.pow(x, 3)))))
30 return x * cdf
31
32
33def layer_norm(input_tensor, name=None):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected