code: def __init__(
      self,
      input_size: int = None,
      hidden_size: int = 256,
      cell_type: str = "rnn",
      max_sequence_length: Optional[int] = None,
      num_layers: int = 1,
      bidirectional: bool = False,
      use_bias: bool = True,
      dropout: float = 0.0,
      **kwargs,
  ):
      super().__init__()
      self.supports_masking = True
      self.input_size = input_size  # api doc: H_in
      self.hidden_size = hidden_size  # api doc: H_out
      self.max_sequence_length = (
          max_sequence_length  # api doc: L (sequence length)
      )
  
      rnn_layer_class = get_from_registry(
          cell_type, rnn_layers_registry
      )
  
      rnn_params = {
          "num_layers": num_layers,
          "bias": use_bias,
          "dropout": dropout,
          "bidirectional": bidirectional,
      }
  
      # Delegate recurrent params to PyTorch's RNN/GRU/LSTM implementations.
      self.layers = rnn_layer_class(
          input_size, hidden_size, batch_first=True, **rnn_params
      )
  
file_path: ludwig/ludwig/modules/recurrent_modules.py
imports: import logging
  from typing import Optional
  import torch
  from torch.nn import GRU, LSTM, RNN
  from ludwig.utils.misc_utils import get_from_registry
  from ludwig.utils.torch_utils import LudwigModule
label_desc: Use image node_id 1 to create a new RecurrentStack object from inherited base classes: LudwigModule with example: obj = RecurrentStack(input_size, hidden_size, cell_type, max_sequence_length, num_layers, bidirectional, use_bias, dropout)