class_docstr: RoIHead for `SCNet <https://arxiv.org/abs/2012.10150>`_.
  
  Args:
      num_stages (int): number of cascade stages.
      stage_loss_weights (list): loss weight of cascade stages.
      semantic_roi_extractor (dict): config to init semantic roi extractor.
      semantic_head (dict): config to init semantic head.
      feat_relay_head (dict): config to init feature_relay_head.
      glbctx_head (dict): config to init global context head.
docstr: Network forward process. Usually includes backbone, neck and head
  forward without any post-processing.
  
  Args:
      x (List[Tensor]): Multi-level features that may have different
          resolutions.
      rpn_results_list (list[:obj:`InstanceData`]): List of region
          proposals.
      batch_data_samples (list[:obj:`DetDataSample`]): Each item contains
          the meta information of each image and corresponding
          annotations.
  
  Returns
      tuple: A tuple of features from ``bbox_head`` and ``mask_head``
      forward.
docstr_tok: ["Network","forward","process",".","Usually","includes","backbone",",","neck","and","head","forward","without","any","post-processing",".","Args",":","x","(","List","[","Tensor","]",")",":","Multi-level","features","that","may","have","different","resolutions",".","rpn_results_list","(","list","[",":","obj",":","`","InstanceData","`","]",")",":","List","of","region","proposals",".","batch_data_samples","(","list","[",":","obj",":","`","DetDataSample","`","]",")",":","Each","item","contains","the","meta","information","of","each","image","and","corresponding","annotations",".","Returns","tuple",":","A","tuple","of","features","from","``","bbox_head","``","and","``","mask_head","``","forward","."]
code: def forward(
      self,
      x: Tuple[Tensor],
      rpn_results_list: InstanceList,
      batch_data_samples: SampleList,
  ) -> tuple:
      """Network forward process. Usually includes backbone, neck and head
      forward without any post-processing.
  
      Args:
          x (List[Tensor]): Multi-level features that may have different
              resolutions.
          rpn_results_list (list[:obj:`InstanceData`]): List of region
              proposals.
          batch_data_samples (list[:obj:`DetDataSample`]): Each item contains
              the meta information of each image and corresponding
              annotations.
  
      Returns
          tuple: A tuple of features from ``bbox_head`` and ``mask_head``
          forward.
      """
      results = ()
      batch_img_metas = [
          data_samples.metainfo for data_samples in batch_data_samples
      ]
  
      if self.with_semantic:
          _, semantic_feat = self.semantic_head(x)
      else:
          semantic_feat = None
  
      if self.with_glbctx:
          _, glbctx_feat = self.glbctx_head(x)
      else:
          glbctx_feat = None
  
      proposals = [
          rpn_results.bboxes for rpn_results in rpn_results_list
      ]
      num_proposals_per_img = tuple(len(p) for p in proposals)
      rois = bbox2roi(proposals)
      # bbox head
      if self.with_bbox:
          rois, cls_scores, bbox_preds = self._refine_roi(
              x=x,
              rois=rois,
              semantic_feat=semantic_feat,
              glbctx_feat=glbctx_feat,
              batch_img_metas=batch_img_metas,
              num_proposals_per_img=num_proposals_per_img,
          )
          results = results + (cls_scores, bbox_preds)
      # mask head
      if self.with_mask:
          rois = torch.cat(rois)
          bboxes_results = self._bbox_forward(
              stage=-1,
              x=x,
              rois=rois,
              semantic_feat=semantic_feat,
              glbctx_feat=glbctx_feat,
          )
          relayed_feat = bboxes_results["relayed_feat"]
          relayed_feat = self.feat_relay_head(relayed_feat)
          mask_results = self._mask_forward(
              x=x,
              rois=rois,
              semantic_feat=semantic_feat,
              glbctx_feat=glbctx_feat,
              relayed_feat=relayed_feat,
          )
          mask_preds = mask_results["mask_preds"]
          mask_preds = mask_preds.split(num_proposals_per_img, 0)
          results = results + (mask_preds,)
      return results
  
imports: from typing import List, Optional, Tuple
  import torch
  import torch.nn.functional
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox2roi
  from mmdet.utils import ConfigType, InstanceList, OptConfigType
  from ..layers import adaptive_avg_pool2d
  from ..task_modules.samplers import SamplingResult
  from ..utils import empty_instances, unpack_gt_instances
  from .cascade_roi_head import CascadeRoIHead
label_desc: Use image node_id 17 for calling the SCNetRoIHead obj's underlying member method code with example usage: obj.forward(x, rpn_results_list, batch_data_samples) and returns: results