def add_slice_by_size(self, name, input_names, output_name, axis, size):
        """
        Add a slice layer. Equivalent to to numpy slice [start_index: start_index+size],
        Input is list of str which is [input_tensor, begin_id].

        Assume input_tensor has shape (2, 3, 4), and axis=1, size=2.
        This would produce input_tensor[:, begin_id:begin_id+2, :]

        Refer to the ``SliceBySizeLayerParams`` 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 names of this layer.
        output_name: str
            The output blob name of this layer.
        axis: int
            axis along which input is sliced.
        size: int
            The size of which input will be taken

        See Also
        --------
        add_slice, add_slice_static, add_slice_dynamic
        """
        spec_layer = self._add_generic_layer(name, input_names, [output_name])
        spec_layer_params = spec_layer.sliceBySize

        if size < 1:
            raise ValueError("Invalid size value %d. Must be positive." % size)

        spec_layer_params.axis = axis
        spec_layer_params.size = size

        return spec_layer

        Add a slice layer. Equivalent to to numpy slice [start_index: start_index+size],
        Input is list of str which is [input_tensor, begin_id].

        Assume input_tensor has shape (2, 3, 4), and axis=1, size=2.
        This would produce input_tensor[:, begin_id:begin_id+2, :]

        Refer to the ``SliceBySizeLayerParams`` 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 names of this layer.
        output_name: str
            The output blob name of this layer.
        axis: int
            axis along which input is sliced.
        size: int
            The size of which input will be taken

        See Also
        --------
        add_slice, add_slice_static, add_slice_dynamic
        
coremltools/models/neural_network/builder.py