class_docstr: A wrapper of rnn cells, with their corresponding forward function.
  If bidirectional, halve the hidden_size for each cell.
class_docstr_tok: ["A","wrapper","of","rnn","cells",",","with","their","corresponding","forward","function",".","If","bidirectional",",","halve","the","hidden_size","for","each","cell","."]
code: def forward(self, x, hidden, batch_size_per_step):
      fwd_hidden, fwd_output = self.fwd_func.forward(
          x, hidden, batch_size_per_step
      )
      if self.is_bidirectional:
          bwd_hidden, bwd_output = self.bwd_func.forward(
              x, hidden, batch_size_per_step
          )
          # concat hidden and outputs
          combined_hidden = [fwd_hidden, bwd_hidden]
          bi_hiddens, bi_cells = zip(*combined_hidden)
          next_hidden = (
              torch.cat(bi_hiddens, bi_hiddens[0].dim() - 1),
              torch.cat(bi_cells, bi_cells[0].dim() - 1),
          )
          output = torch.cat([fwd_output, bwd_output], x.dim() - 1)
      else:
          next_hidden = fwd_hidden
          output = fwd_output
  
      return next_hidden, output
  
imports: import abc
  import math
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqIncrementalDecoder, transformer
  from pytorch_translate import rnn_cell, utils, vocab_reduction
  from pytorch_translate.research.lexical_choice import lexical_translation
label_desc: Use image node_id 2 for calling the RNNLayer obj's underlying member method code with example usage: obj.forward(x, hidden, batch_size_per_step) and returns: next_hidden,  output