def add_sliding_windows(
        self, name, input_name, output_name, axis, window_size, step=1
    ):
        """
        Add a sliding_windows layer to the model that returns a tensor containing
        all windows of size ``window_size`` * separated by ``step`` along the dimension ``axis``.
        Refer to the ``SlidingWindowsLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_name: str
            The of input blob name of this layer.
        output_name: str
            The output blob name of this layer.
        axis: int
            Axis to perform the operation.
        window_size: int
            Number of elements in the sliding window.
        step: int, optional
            The stride of the input elements in the sliding window, default: 1.

        See Also
        --------
        add_slice, add_slice_static, add_slice_dynamic
        """

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

        spec_layer_params = spec_layer.slidingWindows
        spec_layer_params.axis = axis
        spec_layer_params.windowSize = window_size
        spec_layer_params.step = step

        self.rank_dict[output_name] = self._get_rank(input_name) + 1
        return spec_layer

        Add a sliding_windows layer to the model that returns a tensor containing
        all windows of size ``window_size`` * separated by ``step`` along the dimension ``axis``.
        Refer to the ``SlidingWindowsLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_name: str
            The of input blob name of this layer.
        output_name: str
            The output blob name of this layer.
        axis: int
            Axis to perform the operation.
        window_size: int
            Number of elements in the sliding window.
        step: int, optional
            The stride of the input elements in the sliding window, default: 1.

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