code: def VariableRecurrentReverse(inner):
      def forward(
          input,
          hidden,
          weight,
          batch_sizes,
          input_quantizer,
          weight_quantizer,
      ):
          output = []
          input_offset = input.size(0)
          last_batch_size = batch_sizes[-1]
          initial_hidden = hidden
          flat_hidden = not isinstance(hidden, tuple)
          if flat_hidden:
              hidden = (hidden,)
              initial_hidden = (initial_hidden,)
          hidden = tuple(h[: batch_sizes[-1]] for h in hidden)
          for i in reversed(range(len(batch_sizes))):
              batch_size = batch_sizes[i]
              inc = batch_size - last_batch_size
              if inc > 0:
                  hidden = tuple(
                      torch.cat((h, ih[last_batch_size:batch_size]), 0)
                      for h, ih in zip(hidden, initial_hidden)
                  )
              last_batch_size = batch_size
              step_input = input[
                  input_offset - batch_size : input_offset
              ]
              input_offset -= batch_size
  
              if flat_hidden:
                  hidden = (
                      inner(
                          step_input,
                          hidden[0],
                          *weight,
                          input_quantizer=input_quantizer,
                          weight_quantizer=weight_quantizer,
                      ),
                  )
              else:
                  hidden = inner(
                      step_input,
                      hidden,
                      *weight,
                      input_quantizer=input_quantizer,
                      weight_quantizer=weight_quantizer,
                  )
              output.append(hidden[0])
  
          output.reverse()
          output = torch.cat(output, 0)
          if flat_hidden:
              hidden = hidden[0]
          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 9 for calling a global function with example usage: VariableRecurrentReverse(inner) and returns: forward, hidden,  output