def add_clip(self, name, input_name, output_name, min_value=0.0, max_value=1.0):
        """
        Add a clip layer to the model that performs element-wise clip operation.
        Clip the values in the input tensor to the range [min_value, max_value].
        Refer to the ``ClipLayerParams`` 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.
        min_value: float, optional
            Lower bound / minimum value for clip, default: 0.0.
        max_value: float, optional
            Upper bound / maximum value for clip, default: 1.0.

        See Also
        --------
        add_floor, add_ceil
        """

        spec_layer = self._add_generic_layer(name, [input_name], [output_name])
        spec_layer.clip.MergeFromString(b"")
        spec_params = spec_layer.clip

        spec_params.minVal = float(min_value)
        spec_params.maxVal = float(max_value)

        return spec_layer

        Add a clip layer to the model that performs element-wise clip operation.
        Clip the values in the input tensor to the range [min_value, max_value].
        Refer to the ``ClipLayerParams`` 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.
        min_value: float, optional
            Lower bound / minimum value for clip, default: 0.0.
        max_value: float, optional
            Upper bound / maximum value for clip, default: 1.0.

        See Also
        --------
        add_floor, add_ceil
        
coremltools/models/neural_network/builder.py