def add_softmax_nd(self, name, input_name, output_name, axis):
        """
        Add a softmax_nd layer to the model that performs softmax operation along
        the given axis.
        Refer to the ``SoftmaxNDLayerParams`` 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.
        axis: int
            Axis to perform the softmax operation on.
        """

        spec_layer = self._add_generic_layer(name, [input_name], [output_name])
        spec_layer_params = spec_layer.softmaxND
        spec_layer_params.axis = axis
        return spec_layer

        Add a softmax_nd layer to the model that performs softmax operation along
        the given axis.
        Refer to the ``SoftmaxNDLayerParams`` 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.
        axis: int
            Axis to perform the softmax operation on.
        
coremltools/models/neural_network/builder.py