def add_reverse(self, name, input_name, output_name, reverse_dim=None):
        """
        Add a reverse layer to the model that reverses specific dimensions of
        the input tensor.
        Refer to the ``ReverseLayerParams`` 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.
        reverse_dim: list of int or tuple of int
            Reverse along the dimension, default [1].

        See Also
        --------
        add_reverse_sequence
        """

        if not reverse_dim:
            reverse_dim = [1]

        spec_layer = self._add_generic_layer(name, [input_name], [output_name])
        spec_layer_params = spec_layer.reverse
        spec_layer_params.reverseDim.extend(map(bool, reverse_dim))
        return spec_layer

        Add a reverse layer to the model that reverses specific dimensions of
        the input tensor.
        Refer to the ``ReverseLayerParams`` 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.
        reverse_dim: list of int or tuple of int
            Reverse along the dimension, default [1].

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