class_docstr: RNN wrapper with optional batch norm.
  Instantiates an RNN. If it is an LSTM it initialises the forget gate
  bias =`lstm_gate_bias`. Optionally applies a batch normalisation layer to
  the input with the statistics computed over all time steps.  If dropout > 0
  then it is applied to all layer outputs except the last.
class_docstr_tok: ["RNN","wrapper","with","optional","batch","norm",".","Instantiates","an","RNN",".","If","it","is","an","LSTM","it","initialises","the","forget","gate","bias","=","`","lstm_gate_bias","`",".","Optionally","applies","a","batch","normalisation","layer","to","the","input","with","the","statistics","computed","over","all","time","steps",".","If","dropout",">","0","then","it","is","applied","to","all","layer","outputs","except","the","last","."]
code: def __init__(
      self,
      input_size: int,
      hidden_size: int,
      rnn_type: torch.nn.Module = torch.nn.LSTM,
      rnn_layers: int = 1,
      batch_norm: bool = True,
      dropout: Optional[float] = 0.0,
      forget_gate_bias: Optional[float] = 1.0,
      norm_first_rnn: bool = False,
      t_max: Optional[int] = None,
      weights_init_scale: float = 1.0,
      hidden_hidden_bias_scale: float = 0.0,
      proj_size: int = 0,
  ):
      super().__init__()
      self.rnn_layers = rnn_layers
  
      self.layers = torch.nn.ModuleList()
      for i in range(rnn_layers):
          final_layer = (rnn_layers - 1) == i
  
          self.layers.append(
              RNNLayer(
                  input_size,
                  hidden_size,
                  rnn_type=rnn_type,
                  batch_norm=batch_norm and (norm_first_rnn or i > 0),
                  forget_gate_bias=forget_gate_bias,
                  t_max=t_max,
                  weights_init_scale=weights_init_scale,
                  hidden_hidden_bias_scale=hidden_hidden_bias_scale,
                  proj_size=proj_size,
              )
          )
  
          if dropout is not None and dropout > 0.0 and not final_layer:
              self.layers.append(torch.nn.Dropout(dropout))
  
          input_size = hidden_size
  
imports: import math
  from typing import List, Optional, Tuple, Union
  import numpy
  import torch
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new BNRNNSum object from inherited base classes: torch.nn with example: obj = BNRNNSum(input_size, hidden_size, rnn_type, rnn_layers, batch_norm, dropout, forget_gate_bias, norm_first_rnn, t_max, weights_init_scale, hidden_hidden_bias_scale, proj_size)