class_docstr: Container module for a single RNN layer.
  
  args:
      rnn_type: string, select from 'RNN', 'LSTM' and 'GRU'.
      input_size: int, dimension of the input feature. The input should have shape
                  (batch, seq_len, input_size).
      hidden_size: int, dimension of the hidden state.
      dropout: float, dropout ratio. Default is 0.
      bidirectional: bool, whether the RNN layers are bidirectional. Default is False.
class_docstr_tok: ["Container","module","for","a","single","RNN","layer",".","args",":","rnn_type",":","string",",","select","from","'RNN","'",",","'LSTM","'","and","'GRU","'",".","input_size",":","int",",","dimension","of","the","input","feature",".","The","input","should","have","shape","(","batch",",","seq_len",",","input_size",")",".","hidden_size",":","int",",","dimension","of","the","hidden","state",".","dropout",":","float",",","dropout","ratio",".","Default","is","0.","bidirectional",":","bool",",","whether","the","RNN","layers","are","bidirectional",".","Default","is","False","."]
code: def __init__(
      self,
      rnn_type,
      input_size,
      hidden_size,
      dropout=0,
      bidirectional=False,
  ):
      super().__init__()
  
      rnn_type = rnn_type.upper()
  
      assert rnn_type in [
          "RNN",
          "LSTM",
          "GRU",
      ], f"Only support 'RNN', 'LSTM' and 'GRU', current type: {rnn_type}"
  
      self.rnn_type = rnn_type
      self.input_size = input_size
      self.hidden_size = hidden_size
      self.num_direction = int(bidirectional) + 1
  
      self.rnn = getattr(nn, rnn_type)(
          input_size,
          hidden_size,
          1,
          batch_first=True,
          bidirectional=bidirectional,
      )
  
      self.dropout = nn.Dropout(p=dropout)
  
      # linear projection layer
      self.proj = nn.Linear(
          hidden_size * self.num_direction, input_size
      )
  
file_path: espnet/espnet2/enh/layers/dprnn.py
imports: import torch
  import torch.nn
  from torch.autograd import Variable
label_desc: Use image node_id 1 to create a new SingleRNN object from inherited base classes: nn with example: obj = SingleRNN(rnn_type, input_size, hidden_size, dropout, bidirectional)