def add_gelu(self, name, input_name, output_name, mode="EXACT"):
        """
        Add a GELU (gaussian error linear unit) activation layer, which is:
        ``0.5 * x * (1 + erf(x / sqrt(2)))``.
        Refer to the ``GeluLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_name: str
            The input blob name of this layer.
        output_name: str
            The output blob name of this layer.
        mode: str, optional
            Gelu mode in [EXACT | TANH_APPROXIMATION | SIGMOID_APPROXIMATION], default EXACT.
        """

        spec_layer = self._add_generic_layer(name, [input_name], [output_name])
        spec_layer_params = spec_layer.gelu

        if mode == "EXACT":
            spec_layer_params.mode = _proto.NeuralNetwork_pb2.GeluLayerParams.GeluMode.Value(
                "EXACT"
            )
        elif mode == "TANH_APPROXIMATION":
            spec_layer_params.mode = _proto.NeuralNetwork_pb2.GeluLayerParams.GeluMode.Value(
                "TANH_APPROXIMATION"
            )
        elif mode == "SIGMOID_APPROXIMATION":
            spec_layer_params.mode = _proto.NeuralNetwork_pb2.GeluLayerParams.GeluMode.Value(
                "SIGMOID_APPROXIMATION"
            )
        else:
            raise ValueError("Unsupported Gelu mode %s" % mode)
        return spec_layer

        Add a GELU (gaussian error linear unit) activation layer, which is:
        ``0.5 * x * (1 + erf(x / sqrt(2)))``.
        Refer to the ``GeluLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_name: str
            The input blob name of this layer.
        output_name: str
            The output blob name of this layer.
        mode: str, optional
            Gelu mode in [EXACT | TANH_APPROXIMATION | SIGMOID_APPROXIMATION], default EXACT.
        
coremltools/models/neural_network/builder.py