class_docstr: Stage of 3D ResNet. It expects to have one or more tensors as input for
      single pathway (C2D, I3D, Slow), and multi-pathway (SlowFast) cases.
      More details can be found here:
  
      Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He.
      "SlowFast networks for video recognition."
      https://arxiv.org/pdf/1812.03982.pdf
class_docstr_tok: ["Stage","of","3D","ResNet",".","It","expects","to","have","one","or","more","tensors","as","input","for","single","pathway","(","C2D",",","I3D",",","Slow",")",",","and","multi-pathway","(","SlowFast",")","cases",".","More","details","can","be","found","here",":","Christoph","Feichtenhofer",",","Haoqi","Fan",",","Jitendra","Malik",",","and","Kaiming","He",".","``","SlowFast","networks","for","video","recognition",".","''","https",":","\/\/arxiv.org\/pdf\/1812.03982.pdf"]
code: def forward(self, inputs):
      output = []
      for pathway in range(self.num_pathways):
          x = inputs[pathway]
          for i in range(self.num_blocks[pathway]):
              m = getattr(self, "pathway{}_res{}".format(pathway, i))
              x = m(x)
              if hasattr(
                  self, "pathway{}_nonlocal{}".format(pathway, i)
              ):
                  nln = getattr(
                      self, "pathway{}_nonlocal{}".format(pathway, i)
                  )
                  b, c, t, h, w = x.shape
                  if self.nonlocal_group[pathway] > 1:
                      # Fold temporal dimension into batch dimension.
                      x = x.permute(0, 2, 1, 3, 4)
                      x = x.reshape(
                          b * self.nonlocal_group[pathway],
                          t // self.nonlocal_group[pathway],
                          c,
                          h,
                          w,
                      )
                      x = x.permute(0, 2, 1, 3, 4)
                  x = nln(x)
                  if self.nonlocal_group[pathway] > 1:
                      # Fold back to temporal dimension.
                      x = x.permute(0, 2, 1, 3, 4)
                      x = x.reshape(b, t, c, h, w)
                      x = x.permute(0, 2, 1, 3, 4)
          output.append(x)
  
      return output
  
imports: import torch
  import torch.nn
  from slowfast.models.common import drop_path
  from slowfast.models.nonlocal_helper import Nonlocal
  from slowfast.models.operators import SE, Swish
label_desc: Use image node_id 3 for calling the ResStage obj's underlying member method code with example usage: obj.forward(inputs) and returns: output