class_docstr: Cascade roi head including one bbox head and one mask head.
  
  https://arxiv.org/abs/1712.00726
docstr: Mask head forward function used in both training and testing.
docstr_tok: ["Mask","head","forward","function","used","in","both","training","and","testing","."]
code: def _mask_forward(self, stage, x, rois):
      """Mask head forward function used in both training and testing."""
      mask_roi_extractor = self.mask_roi_extractor[stage]
      mask_head = self.mask_head[stage]
      mask_feats = mask_roi_extractor(
          x[: mask_roi_extractor.num_inputs], rois
      )
      # do not support caffe_c4 model anymore
      mask_pred = mask_head(mask_feats)
  
      mask_results = dict(mask_pred=mask_pred)
      return mask_results
  
imports: import torch
  import torch.nn
  from mmdet.core import bbox2result, bbox2roi, bbox_mapping, build_assigner, build_sampler, merge_aug_bboxes, merge_aug_masks, multiclass_nms
  from ..builder import HEADS, build_head, build_roi_extractor
  from .base_roi_head import BaseRoIHead
  from .test_mixins import BBoxTestMixin, MaskTestMixin
label_desc: Use image node_id 9 for calling the CascadeRoIHead obj's underlying member method code with example usage: obj._mask_forward(stage, x, rois) and returns: mask_results