class_docstr: Anchor-free head (FCOS, Fovea, RepPoints, etc.).
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      feat_channels (int): Number of hidden channels. Used in child classes.
      stacked_convs (int): Number of stacking convs of the head.
      strides (tuple): Downsample factor of each feature map.
      dcn_on_last_conv (bool): If true, use dcn in the last layer of
          towers. Default: False.
      conv_bias (bool | str): If specified as `auto`, it will be decided by
          the norm_cfg. Bias of conv will be set as True if `norm_cfg` is
          None, otherwise False. Default: "auto".
      loss_cls (dict): Config of classification loss.
      loss_bbox (dict): Config of localization loss.
      conv_cfg (dict): Config dict for convolution layer. Default: None.
      norm_cfg (dict): Config dict for normalization layer. Default: None.
      train_cfg (dict): Training config of anchor head.
      test_cfg (dict): Testing config of anchor head.
class_docstr_tok: ["Anchor-free","head","(","FCOS",",","Fovea",",","RepPoints",",","etc.",")",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","feat_channels","(","int",")",":","Number","of","hidden","channels",".","Used","in","child","classes",".","stacked_convs","(","int",")",":","Number","of","stacking","convs","of","the","head",".","strides","(","tuple",")",":","Downsample","factor","of","each","feature","map",".","dcn_on_last_conv","(","bool",")",":","If","true",",","use","dcn","in","the","last","layer","of","towers",".","Default",":","False",".","conv_bias","(","bool","|","str",")",":","If","specified","as","`","auto","`",",","it","will","be","decided","by","the","norm_cfg",".","Bias","of","conv","will","be","set","as","True","if","`","norm_cfg","`","is","None",",","otherwise","False",".","Default",":","``","auto","''",".","loss_cls","(","dict",")",":","Config","of","classification","loss",".","loss_bbox","(","dict",")",":","Config","of","localization","loss",".","conv_cfg","(","dict",")",":","Config","dict","for","convolution","layer",".","Default",":","None",".","norm_cfg","(","dict",")",":","Config","dict","for","normalization","layer",".","Default",":","None",".","train_cfg","(","dict",")",":","Training","config","of","anchor","head",".","test_cfg","(","dict",")",":","Testing","config","of","anchor","head","."]
docstr: Compute loss of the head.
  
  Args:
      cls_scores (list[Tensor]): Box scores for each scale level,
          each is a 4D-tensor, the channel number is
          num_points * num_classes.
      bbox_preds (list[Tensor]): Box energies / deltas for each scale
          level, each is a 4D-tensor, the channel number is
          num_points * 4.
      gt_bboxes (list[Tensor]): Ground truth bboxes for each image with
          shape (num_gts, 4) in [tl_x, tl_y, br_x, br_y] format.
      gt_labels (list[Tensor]): class indices corresponding to each box
      img_metas (list[dict]): Meta information of each image, e.g.,
          image size, scaling factor, etc.
      gt_bboxes_ignore (None | list[Tensor]): specify which bounding
          boxes can be ignored when computing the loss.
docstr_tok: ["Compute","loss","of","the","head",".","Args",":","cls_scores","(","list","[","Tensor","]",")",":","Box","scores","for","each","scale","level",",","each","is","a","4D-tensor",",","the","channel","number","is","num_points","*","num_classes",".","bbox_preds","(","list","[","Tensor","]",")",":","Box","energies","\/","deltas","for","each","scale","level",",","each","is","a","4D-tensor",",","the","channel","number","is","num_points","*","4.","gt_bboxes","(","list","[","Tensor","]",")",":","Ground","truth","bboxes","for","each","image","with","shape","(","num_gts",",","4",")","in","[","tl_x",",","tl_y",",","br_x",",","br_y","]","format",".","gt_labels","(","list","[","Tensor","]",")",":","class","indices","corresponding","to","each","box","img_metas","(","list","[","dict","]",")",":","Meta","information","of","each","image",",","e.g.",",","image","size",",","scaling","factor",",","etc",".","gt_bboxes_ignore","(","None","|","list","[","Tensor","]",")",":","specify","which","bounding","boxes","can","be","ignored","when","computing","the","loss","."]
code: def loss(
      self,
      cls_scores,
      bbox_preds,
      gt_bboxes,
      gt_labels,
      img_metas,
      gt_bboxes_ignore=None,
  ):
      """Compute loss of the head.
  
      Args:
          cls_scores (list[Tensor]): Box scores for each scale level,
              each is a 4D-tensor, the channel number is
              num_points * num_classes.
          bbox_preds (list[Tensor]): Box energies / deltas for each scale
              level, each is a 4D-tensor, the channel number is
              num_points * 4.
          gt_bboxes (list[Tensor]): Ground truth bboxes for each image with
              shape (num_gts, 4) in [tl_x, tl_y, br_x, br_y] format.
          gt_labels (list[Tensor]): class indices corresponding to each box
          img_metas (list[dict]): Meta information of each image, e.g.,
              image size, scaling factor, etc.
          gt_bboxes_ignore (None | list[Tensor]): specify which bounding
              boxes can be ignored when computing the loss.
      """
  
      raise NotImplementedError
  
imports: from abc import abstractmethod
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init
  from mmcv.runner import force_fp32
  from mmdet.core import multi_apply
  from ..builder import HEADS, build_loss
  from .base_dense_head import BaseDenseHead
  from .dense_test_mixins import BBoxTestMixin
label_desc: Use image node_id 10 for calling the AnchorFreeHead obj's underlying member method code with example usage: obj.loss(cls_scores, bbox_preds, gt_bboxes, gt_labels, img_metas, gt_bboxes_ignore) without return types