def io_processor(forward):
    """Applies some input / output processing to PLForecastingModule.forward.
    Note that this wrapper must be added to each of PLForecastinModule's subclasses forward methods.
    Here is an example how to add the decorator:

    ```python
        @io_processor
        def forward(self, *args, **kwargs)
            pass
    ```

    Applies
    -------
    Reversible Instance Normalization
        normalizes batch input target features, and inverse transform the forward output back to the original scale
    """

    @wraps(forward)
    def forward_wrapper(self, x_in: PLModuleInput, *args, **kwargs):
        if not self.use_reversible_instance_norm:
            return forward(self, x_in, *args, **kwargs)

        # `x_in` is input batch tuple which by definition has the past features in the first element
        # starting with the first n target features; clone it to prevent target re-normalization
        past_features = x_in[0].clone()
        # apply reversible instance normalization
        past_features[:, :, : self.n_targets] = self.rin(
            past_features[:, :, : self.n_targets]
        )
        # run the forward pass
        out = forward(self, *((past_features, *x_in[1:]), *args), **kwargs)
        # inverse transform target output back to original scale
        if isinstance(out, tuple):
            # RNNModel return tuple with hidden state
            return self.rin.inverse(out[0]), *out[1:]
        else:
            # all other models return only the prediction
            return self.rin.inverse(out)

    return forward_wrapper
Applies some input / output processing to PLForecastingModule.forward.
    Note that this wrapper must be added to each of PLForecastinModule's subclasses forward methods.
    Here is an example how to add the decorator:

    ```python
        @io_processor
        def forward(self, *args, **kwargs)
            pass
    ```

    Applies
    -------
    Reversible Instance Normalization
        normalizes batch input target features, and inverse transform the forward output back to the original scale
    
darts/models/forecasting/pl_forecasting_module.py