class_docstr: RNN module.
  
  Args:
      idim: Input dimension.
      rnn_type: RNN units type.
      elayers: Number of RNN layers.
      eunits: Number of units ((2 * eunits) if bidirectional)
      eprojs: Number of final projection units.
      dropout_rate: Dropout rate for RNN layers.
      aux_output_layers: List of layer IDs for auxiliary RNN output sequences.
class_docstr_tok: ["RNN","module",".","Args",":","idim",":","Input","dimension",".","rnn_type",":","RNN","units","type",".","elayers",":","Number","of","RNN","layers",".","eunits",":","Number","of","units","(","(","2","*","eunits",")","if","bidirectional",")","eprojs",":","Number","of","final","projection","units",".","dropout_rate",":","Dropout","rate","for","RNN","layers",".","aux_output_layers",":","List","of","layer","IDs","for","auxiliary","RNN","output","sequences","."]
docstr: Initialize RNN module.
docstr_tok: ["Initialize","RNN","module","."]
code: def __init__(
      self,
      idim: int,
      rnn_type: str,
      elayers: int,
      eunits: int,
      eprojs: int,
      dropout_rate: float,
      aux_output_layers: List = [],
  ):
      """Initialize RNN module."""
      super().__init__()
  
      bidir = rnn_type[0] == "b"
  
      for i in range(elayers):
          if i == 0:
              input_dim = idim
          else:
              input_dim = eunits
  
          rnn_layer = (
              torch.nn.LSTM if "lstm" in rnn_type else torch.nn.GRU
          )
          rnn = rnn_layer(
              input_dim,
              eunits,
              num_layers=1,
              bidirectional=bidir,
              batch_first=True,
          )
  
          setattr(self, "%s%d" % ("birnn" if bidir else "rnn", i), rnn)
  
      self.dropout = torch.nn.Dropout(p=dropout_rate)
  
      self.elayers = elayers
      self.eunits = eunits
      self.eprojs = eprojs
      self.rnn_type = rnn_type
      self.bidir = bidir
  
      self.l_last = torch.nn.Linear(eunits, eprojs)
  
      self.aux_output_layers = aux_output_layers
  
imports: from argparse import Namespace
  from typing import List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn.functional
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
  from espnet.nets.e2e_asr_common import get_vgg2l_odim
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask, to_device
label_desc: Use image node_id 1 to create a new RNN object from inherited base classes: torch.nn with example: obj = RNN(idim, rnn_type, elayers, eunits, eprojs, dropout_rate, aux_output_layers)