class_docstr: stackedRNN
class_docstr_tok: ["stackedRNN"]
code: def __init__(self, inputRNN, num_layers=1, dropout=0):
      super(stackedRNN, self).__init__()
  
      self.dropout = dropout
  
      if isinstance(inputRNN, RNNCell):
          self.rnns = [inputRNN]
          for i in range(num_layers - 1):
              self.rnns.append(inputRNN.new_like(inputRNN.output_size))
      elif isinstance(inputRNN, list):
          assert (
              len(inputRNN) == num_layers
          ), "RNN list length must be equal to num_layers"
          self.rnns = inputRNN
      else:
          raise RuntimeError()
  
      self.nLayers = len(self.rnns)
  
      self.rnns = nn.ModuleList(self.rnns)
  
imports: import torch
  import torch.nn
  from torch.autograd import Variable
  import torch.nn.functional
  import math
label_desc: Use image node_id 1 to create a new stackedRNN object from inherited base classes: nn with example: obj = stackedRNN(inputRNN, num_layers, dropout)