def add_split_nd(
        self, name, input_name, output_names, axis, num_splits=2, split_sizes=None
    ):
        """
        Add a split layer to the model that splits the input tensor into multiple
        output tensors. Either uniformly split the input tensor into ``num_splits``
        tensors, or split into given size list ``split_sizes`` output tensors.
        Refer to the ``SplitNDLayerParams`` 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_names: list of str
            The output blob names of this layer.
        axis: int
            Axis to perform split on.
        num_splits: int, optional
            Number of splits, default: 2.
        split_sizes: list of int or tuple of int, optional
            List of size to split, default ``[]`` or ``None``.
        """

        if not split_sizes:
            split_sizes = []

        spec_layer = self._add_generic_layer(name, [input_name], output_names)
        spec_layer_params = spec_layer.splitND
        spec_layer_params.axis = axis

        if split_sizes and len(split_sizes) > 0:
            spec_layer_params.splitSizes.extend(split_sizes)
            spec_layer_params.numSplits = len(split_sizes)
        else:
            spec_layer_params.numSplits = num_splits

        assert len(output_names) == spec_layer_params.numSplits
        return spec_layer

        Add a split layer to the model that splits the input tensor into multiple
        output tensors. Either uniformly split the input tensor into ``num_splits``
        tensors, or split into given size list ``split_sizes`` output tensors.
        Refer to the ``SplitNDLayerParams`` 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_names: list of str
            The output blob names of this layer.
        axis: int
            Axis to perform split on.
        num_splits: int, optional
            Number of splits, default: 2.
        split_sizes: list of int or tuple of int, optional
            List of size to split, default ``[]`` or ``None``.
        
coremltools/models/neural_network/builder.py