docstr: type_rnn: RNN, GRU, LSTM 可选
docstr_tok: ["type_rnn",":","RNN",",","GRU",",","LSTM","\u53ef\u9009"]
code: def __init__(self, config):
      """
      type_rnn: RNN, GRU, LSTM 可选
      """
      super(RNN, self).__init__()
  
      # self.xxx = config.xxx
      self.input_size = config.input_size
      self.hidden_size = (
          config.hidden_size // 2
          if config.bidirectional
          else config.hidden_size
      )
      self.num_layers = config.num_layers
      self.dropout = config.dropout
      self.bidirectional = config.bidirectional
      self.last_layer_hn = config.last_layer_hn
      self.type_rnn = config.type_rnn
  
      rnn = eval(f"nn.{self.type_rnn}")
      self.rnn = rnn(
          input_size=self.input_size,
          hidden_size=self.hidden_size,
          num_layers=self.num_layers,
          dropout=self.dropout,
          bidirectional=self.bidirectional,
          bias=True,
          batch_first=True,
      )
  
imports: import torch
  import torch.nn
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
label_desc: Use image node_id 1 to create a new RNN object from inherited base classes: nn with example: obj = RNN(config)