class_docstr: ResNe(X)t RoI head.
class_docstr_tok: ["ResNe","(","X",")","t","RoI","head","."]
code: def forward(self, inputs, bboxes):
      assert (
          len(inputs) == self.num_pathways
      ), "Input tensor does not contain {} pathway".format(
          self.num_pathways
      )
      pool_out = []
      for pathway in range(self.num_pathways):
          t_pool = getattr(self, "s{}_tpool".format(pathway))
          out = t_pool(inputs[pathway])
          assert out.shape[2] == 1
          out = torch.squeeze(out, 2)
  
          roi_align = getattr(self, "s{}_roi".format(pathway))
          out = roi_align(out, bboxes)
  
          s_pool = getattr(self, "s{}_spool".format(pathway))
          pool_out.append(s_pool(out))
  
      # B C H W.
      x = torch.cat(pool_out, 1)
  
      # Perform dropout.
      if hasattr(self, "dropout"):
          x = self.dropout(x)
  
      x = x.view(x.shape[0], -1)
      if self.detach_final_fc:
          x = x.detach()
      x = self.projection(x)
      x = self.act(x)
      return x
  
imports: from functools import partial
  import torch
  import torch.nn
  from detectron2.layers import ROIAlign
  import slowfast.utils.logging
  from slowfast.models.attention import MultiScaleBlock
  from slowfast.models.batchnorm_helper import NaiveSyncBatchNorm1d
  from slowfast.models.nonlocal_helper import Nonlocal
label_desc: Use image node_id 2 for calling the ResNetRoIHead obj's underlying member method code with example usage: obj.forward(inputs, bboxes) and returns: x