class_docstr: FCOSR Head, refer to https://arxiv.org/abs/2111.10780 for details 
class_docstr_tok: ["FCOSR","Head",",","refer","to","https",":","\/\/arxiv.org\/abs\/2111.10780","for","details"]
code: def get_loss(self, head_outs, gt_meta):
      (
          cls_pred_list,
          reg_pred_list,
          anchor_points,
          stride_tensor,
          num_anchors_list,
      ) = head_outs
      gt_labels = gt_meta["gt_class"]
      gt_bboxes = gt_meta["gt_bbox"]
      gt_rboxes = gt_meta["gt_rbox"]
      pad_gt_mask = gt_meta["pad_gt_mask"]
      # decode
      pred_rboxes = self._bbox_decode(anchor_points, reg_pred_list)
      # label assignment
      assigned_labels, assigned_rboxes, assigned_scores = self.assigner(
          anchor_points,
          stride_tensor,
          num_anchors_list,
          gt_labels,
          gt_bboxes,
          gt_rboxes,
          pad_gt_mask,
          self.num_classes,
          pred_rboxes,
      )
  
      # reg_loss
      mask_positive = assigned_labels != self.num_classes
      num_pos = mask_positive.sum().item()
      if num_pos > 0:
          bbox_mask = mask_positive.unsqueeze(-1).tile([1, 1, 5])
          pred_rboxes_pos = paddle.masked_select(
              pred_rboxes, bbox_mask
          ).reshape([-1, 5])
          assigned_rboxes_pos = paddle.masked_select(
              assigned_rboxes, bbox_mask
          ).reshape([-1, 5])
          bbox_weight = paddle.masked_select(
              assigned_scores.sum(-1), mask_positive
          ).reshape([-1])
          avg_factor = bbox_weight.sum()
          loss_probiou = self.probiou_loss(
              pred_rboxes_pos, assigned_rboxes_pos
          )
          loss_probiou = (
              paddle.sum(loss_probiou * bbox_weight) / avg_factor
          )
      else:
          loss_probiou = pred_rboxes.sum() * 0.0
  
      avg_factor = max(num_pos, 1.0)
      # cls_loss
      loss_cls = self._qfocal_loss(
          cls_pred_list, assigned_scores, reduction="sum"
      )
      loss_cls = loss_cls / avg_factor
  
      loss = (
          self.loss_weight["class"] * loss_cls
          + self.loss_weight["probiou"] * loss_probiou
      )
      out_dict = {
          "loss": loss,
          "loss_probiou": loss_probiou,
          "loss_cls": loss_cls,
      }
      return out_dict
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from .fcos_head import ScaleReg
  from ..initializer import bias_init_with_prob, constant_, normal_
  from ..ops import get_act_fn, anchor_generator
  from ..rbox_utils import box2corners
  from ..losses import ProbIoULoss
  import numpy
label_desc: Use image node_id 10 for calling the FCOSRHead obj's underlying member method code with example usage: obj.get_loss(head_outs, gt_meta) and returns: out_dict