def add_load_constant_nd(self, name, output_name, constant_value, shape):
        """
        Add a load_constant layer that loads data as a parameter and provides it
        as an output.
        Refer to the ``LoadConstantNDLayerParams`` message in the specification
        (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        output_name: str
            The output blob name of this layer.
        constant_value: numpy.array()
            value of the constant as a numpy array.
        shape: list of int or tuple of int
            List of ints representing the shape of the constant.

        See Also
        --------
        add_elementwise
        """

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

        data = spec_layer_params.data
        data.floatValue.extend(constant_value.flatten())
        spec_layer_params.shape.extend(shape)

        # Rank information
        self.rank_dict[output_name] = len(shape)

        if len(data.floatValue) != _np.prod(shape):
            raise ValueError(
                "Dimensions of 'shape' do not match the size of the provided constant"
            )
        return spec_layer

        Add a load_constant layer that loads data as a parameter and provides it
        as an output.
        Refer to the ``LoadConstantNDLayerParams`` message in the specification
        (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        output_name: str
            The output blob name of this layer.
        constant_value: numpy.array()
            value of the constant as a numpy array.
        shape: list of int or tuple of int
            List of ints representing the shape of the constant.

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