code: def add_mask_rcnn_losses(model, blob_mask):
      """Add Mask R-CNN specific losses."""
      loss_mask = model.net.SigmoidCrossEntropyLoss(
          [blob_mask, "masks_int32"],
          "loss_mask",
          scale=model.GetLossScale() * cfg.MRCNN.WEIGHT_LOSS_MASK,
      )
      loss_gradients = blob_utils.get_loss_gradients(model, [loss_mask])
      model.AddLosses("loss_mask")
      return loss_gradients
  
file_path: dense-pose/detectron/modeling/mask_rcnn_heads.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from detectron.core.config import cfg
  from detectron.utils.c2 import const_fill
  from detectron.utils.c2 import gauss_fill
  from detectron.utils.net import get_group_gn
  import detectron.modeling.ResNet
  import detectron.utils.blob
label_desc: Use image node_id 2 for calling a global function with example usage: add_mask_rcnn_losses(model, blob_mask) and returns: loss_gradients