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)
| 2904 | |
| 2905 | @tf_export("nn.gelu") |
| 2906 | def 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 | |
| 2924 | def _flatten_outer_dims(logits): |