class_docstr: `PointRend <https://arxiv.org/abs/1912.08193>`_.
class_docstr_tok: ["`","PointRend","<","https",":","\/\/arxiv.org\/abs\/1912.08193",">","`","_","."]
docstr: Run forward function and calculate loss for mask head and point head
  in training.
docstr_tok: ["Run","forward","function","and","calculate","loss","for","mask","head","and","point","head","in","training","."]
code: def mask_loss(
      self,
      x: Tuple[Tensor],
      sampling_results: List[SamplingResult],
      bbox_feats: Tensor,
      batch_gt_instances: InstanceList,
  ) -> dict:
      """Run forward function and calculate loss for mask head and point head
      in training."""
      mask_results = super().mask_loss(
          x=x,
          sampling_results=sampling_results,
          bbox_feats=bbox_feats,
          batch_gt_instances=batch_gt_instances,
      )
  
      mask_point_results = self._mask_point_loss(
          x=x,
          sampling_results=sampling_results,
          mask_preds=mask_results["mask_preds"],
          batch_gt_instances=batch_gt_instances,
      )
      mask_results["loss_mask"].update(
          loss_point=mask_point_results["loss_point"]
      )
  
      return mask_results
  
file_path: mmdetection/mmdet/models/roi_heads/point_rend_roi_head.py
imports: from typing import List, Tuple
  import torch
  import torch.nn.functional
  from mmcv.ops import point_sample, rel_roi_point_to_rel_img_point
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import bbox2roi
  from mmdet.utils import ConfigType, InstanceList
  from ..task_modules.samplers import SamplingResult
  from ..utils import empty_instances
  from .standard_roi_head import StandardRoIHead
label_desc: Use image node_id 3 for calling the PointRendRoIHead obj's underlying member method code with example usage: obj.mask_loss(x, sampling_results, bbox_feats, batch_gt_instances) and returns: mask_results