def add_constant_pad(
        self,
        name,
        input_names,
        output_name,
        value=0.0,
        pad_to_given_output_size_mode=False,
        pad_amounts=[],
    ):
        """
        Add a constant pad layer.
        Refer to the ``ConstantPaddingLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_names: list of str
            The input blob name(s) of this layer.
        output_name: str
            The output blob name of this layer.
        value: float
            value to be used for padding.
        pad_to_given_output_size_mode: bool
            if true, pad_amounts are interpreted as output shapes (see example in NeuralNetwork.proto)
        pad_amounts: [int], optional
            must be non negative. Amount to pad in each dimension. Length of the list must be twice the input/output rank.
            Not required if second input is present.

        See Also
        --------
        add_padding
        """

        spec_layer = self._add_generic_layer(name, input_names, [output_name])
        spec_layer_params = spec_layer.constantPad
        spec_layer_params.value = value
        spec_layer_params.padToGivenOutputSizeMode = pad_to_given_output_size_mode
        if len(pad_amounts) > 0:
            spec_layer_params.padAmounts.extend(map(int, pad_amounts))
        if len(input_names) == 1 and len(pad_amounts) == 0:
            raise ValueError(
                "Constant_pad layer: pad_amounts must be provided when there is a single input"
            )
        return spec_layer

        Add a constant pad layer.
        Refer to the ``ConstantPaddingLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_names: list of str
            The input blob name(s) of this layer.
        output_name: str
            The output blob name of this layer.
        value: float
            value to be used for padding.
        pad_to_given_output_size_mode: bool
            if true, pad_amounts are interpreted as output shapes (see example in NeuralNetwork.proto)
        pad_amounts: [int], optional
            must be non negative. Amount to pad in each dimension. Length of the list must be twice the input/output rank.
            Not required if second input is present.

        See Also
        --------
        add_padding
        
coremltools/models/neural_network/builder.py