MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / gelu

Function gelu

tensorflow/python/ops/nn_ops.py:2906–2921  ·  view source on GitHub ↗

Compute the Gaussian Error Linear Unit (GELU) activation function. Source: [Gaussian Error Linear Units (GELUs)](https://arxiv.org/abs/1606.08415). Args: features: A `Tensor` representing preactivation values. Must be one of approximate: Whether to enable approximation. name: A nam

(features, approximate=False, name=None)

Source from the content-addressed store, hash-verified

2904
2905@tf_export("nn.gelu")
2906def gelu(features, approximate=False, name=None):
2907 """Compute the Gaussian Error Linear Unit (GELU) activation function.
2908
2909 Source: [Gaussian Error Linear Units (GELUs)](https://arxiv.org/abs/1606.08415).
2910
2911 Args:
2912 features: A `Tensor` representing preactivation values. Must be one of
2913 approximate: Whether to enable approximation.
2914 name: A name for the operation (optional).
2915
2916 Returns:
2917 A `Tensor` with the same type as `features`.
2918 """
2919 with ops.name_scope(name, "Gelu", [features, approximate]) as name:
2920 features = ops.convert_to_tensor(features, name="features")
2921 return gen_nn_ops.gelu(features, approximate=approximate, name=name)
2922
2923
2924def _flatten_outer_dims(logits):

Callers 1

testMethod · 0.70

Calls 2

name_scopeMethod · 0.45
geluMethod · 0.45

Tested by 1

testMethod · 0.56