def __init__(
        self,
        name: str,
        activation: Optional[str] = None,
        **kwargs,
    ):
        """PyTorch module implementing a block RNN to be used in `BlockRNNModel`.

        PyTorch module implementing a simple block RNN with the specified `name` layer.
        This module combines a PyTorch RNN module, together with a fully connected network, which maps the
        last hidden layers to output of the desired size `output_chunk_length` and makes it compatible with
        `BlockRNNModel`s.

        This module uses an RNN to encode the input sequence, and subsequently uses a fully connected
        network as the decoder which takes as input the last hidden state of the encoder RNN.
        Optionally, a non-linear activation function can be applied between the layers of the fully connected network.
        The final output of the decoder is a sequence of length `output_chunk_length`. In this sense,
        the `_BlockRNNModule` produces 'blocks' of forecasts at a time (which is different
        from `_RNNModule` used by the `RNNModel`).

        Parameters
        ----------
        name
            The name of the specific PyTorch RNN module ("RNN", "GRU" or "LSTM").
        activation
            The name of the activation function to be applied between the layers of the fully connected network.
            Options include "ReLU", "Sigmoid", "Tanh", or None for no activation. Default: None.
        **kwargs
            all parameters required for the :class:`darts.models.forecasting.CustomBlockRNNModule` base class.

        Inputs
        ------
        x of shape `(batch_size, input_chunk_length, input_size, nr_params)`
            Tensor containing the features of the input sequence.

        Outputs
        -------
        y of shape `(batch_size, output_chunk_length, target_size, nr_params)`
            Tensor containing the prediction at the last time step of the sequence.
        """

        super().__init__(**kwargs)

        self.name = name

        # Defining the RNN module
        self.rnn = getattr(nn, self.name)(
            self.input_size,
            self.hidden_dim,
            self.num_layers,
            batch_first=True,
            dropout=self.dropout,
        )

        # The RNN module is followed by a fully connected layer, which maps the last hidden layer
        # to the output of desired length
        last = self.hidden_dim
        feats = []
        for index, feature in enumerate(
            self.num_layers_out_fc + [self.out_len * self.target_size * self.nr_params]
        ):
            feats.append(nn.Linear(last, feature))

            # Add activation only between layers, but not on the final layer
            if activation and index < len(self.num_layers_out_fc):
                activation_function = getattr(nn, activation)()
                feats.append(activation_function)
            last = feature
        self.fc = nn.Sequential(*feats)
PyTorch module implementing a block RNN to be used in `BlockRNNModel`.

        PyTorch module implementing a simple block RNN with the specified `name` layer.
        This module combines a PyTorch RNN module, together with a fully connected network, which maps the
        last hidden layers to output of the desired size `output_chunk_length` and makes it compatible with
        `BlockRNNModel`s.

        This module uses an RNN to encode the input sequence, and subsequently uses a fully connected
        network as the decoder which takes as input the last hidden state of the encoder RNN.
        Optionally, a non-linear activation function can be applied between the layers of the fully connected network.
        The final output of the decoder is a sequence of length `output_chunk_length`. In this sense,
        the `_BlockRNNModule` produces 'blocks' of forecasts at a time (which is different
        from `_RNNModule` used by the `RNNModel`).

        Parameters
        ----------
        name
            The name of the specific PyTorch RNN module ("RNN", "GRU" or "LSTM").
        activation
            The name of the activation function to be applied between the layers of the fully connected network.
            Options include "ReLU", "Sigmoid", "Tanh", or None for no activation. Default: None.
        **kwargs
            all parameters required for the :class:`darts.models.forecasting.CustomBlockRNNModule` base class.

        Inputs
        ------
        x of shape `(batch_size, input_chunk_length, input_size, nr_params)`
            Tensor containing the features of the input sequence.

        Outputs
        -------
        y of shape `(batch_size, output_chunk_length, target_size, nr_params)`
            Tensor containing the prediction at the last time step of the sequence.
        
darts/models/forecasting/block_rnn_model.py