code: def Recurrent(inner, reverse=False):
      def forward(
          input,
          hidden,
          weight,
          batch_sizes,
          input_quantizer,
          weight_quantizer,
      ):
          output = []
          steps = (
              range(input.size(0) - 1, -1, -1)
              if reverse
              else range(input.size(0))
          )
          for i in steps:
              hidden = inner(
                  input[i],
                  hidden,
                  *weight,
                  input_quantizer=input_quantizer,
                  weight_quantizer=weight_quantizer,
              )
              # hack to handle LSTM
              output.append(
                  hidden[0] if isinstance(hidden, tuple) else hidden
              )
  
          if reverse:
              output.reverse()
          output = torch.cat(output, 0).view(
              input.size(0), *output[0].size()
          )
  
          return hidden, output
  
      return forward
  
file_path: lightseq/lightseq/csrc/pytorch/pytorch_quantization/nn/_functions/quant_rnn.py
imports: import warnings
  from torch.autograd import NestedIOFunction
  from torch.nn import functional
  import torch
  import itertools
  from functools import partial
label_desc: Use image node_id 6 for calling a global function with example usage: Recurrent(inner, reverse) and returns: forward, hidden,  output