class_docstr: AutoAssignHead head used in AutoAssign.
  
  More details can be found in the `paper
  <https://arxiv.org/abs/2007.03496>`_ .
  
  Args:
      force_topk (bool): Used in center prior initialization to
          handle extremely small gt. Default is False.
      topk (int): The number of points used to calculate the
          center prior when no point falls in gt_bbox. Only work when
          force_topk if True. Defaults to 9.
      pos_loss_weight (float): The loss weight of positive loss
          and with default value 0.25.
      neg_loss_weight (float): The loss weight of negative loss
          and with default value 0.75.
      center_loss_weight (float): The loss weight of center prior
          loss and with default value 0.75.
class_docstr_tok: ["AutoAssignHead","head","used","in","AutoAssign",".","More","details","can","be","found","in","the","`","paper","<","https",":","\/\/arxiv.org\/abs\/2007.03496",">","`","_",".","Args",":","force_topk","(","bool",")",":","Used","in","center","prior","initialization","to","handle","extremely","small","gt",".","Default","is","False",".","topk","(","int",")",":","The","number","of","points","used","to","calculate","the","center","prior","when","no","point","falls","in","gt_bbox",".","Only","work","when","force_topk","if","True",".","Defaults","to","9.","pos_loss_weight","(","float",")",":","The","loss","weight","of","positive","loss","and","with","default","value","0.25.","neg_loss_weight","(","float",")",":","The","loss","weight","of","negative","loss","and","with","default","value","0.75.","center_loss_weight","(","float",")",":","The","loss","weight","of","center","prior","loss","and","with","default","value","0.75","."]
docstr: Forward features of a single scale level.
  
  Args:
      x (Tensor): FPN feature maps of the specified stride.
      scale (:obj:`mmcv.cnn.Scale`): Learnable scale module to resize
          the bbox prediction.
      stride (int): The corresponding stride for feature maps, only
          used to normalize the bbox prediction when self.norm_on_bbox
          is True.
  
  Returns:
      tuple[Tensor, Tensor, Tensor]: scores for each class, bbox
      predictions and centerness predictions of input feature maps.
docstr_tok: ["Forward","features","of","a","single","scale","level",".","Args",":","x","(","Tensor",")",":","FPN","feature","maps","of","the","specified","stride",".","scale","(",":","obj",":","`","mmcv.cnn.Scale","`",")",":","Learnable","scale","module","to","resize","the","bbox","prediction",".","stride","(","int",")",":","The","corresponding","stride","for","feature","maps",",","only","used","to","normalize","the","bbox","prediction","when","self.norm_on_bbox","is","True",".","Returns",":","tuple","[","Tensor",",","Tensor",",","Tensor","]",":","scores","for","each","class",",","bbox","predictions","and","centerness","predictions","of","input","feature","maps","."]
code: def forward_single(
      self, x: Tensor, scale: Scale, stride: int
  ) -> Tuple[Tensor, Tensor, Tensor]:
      """Forward features of a single scale level.
  
      Args:
          x (Tensor): FPN feature maps of the specified stride.
          scale (:obj:`mmcv.cnn.Scale`): Learnable scale module to resize
              the bbox prediction.
          stride (int): The corresponding stride for feature maps, only
              used to normalize the bbox prediction when self.norm_on_bbox
              is True.
  
      Returns:
          tuple[Tensor, Tensor, Tensor]: scores for each class, bbox
          predictions and centerness predictions of input feature maps.
      """
      cls_score, bbox_pred, cls_feat, reg_feat = super(
          FCOSHead, self
      ).forward_single(x)
      centerness = self.conv_centerness(reg_feat)
      # scale the bbox_pred of different level
      # float to avoid overflow when enabling FP16
      bbox_pred = scale(bbox_pred).float()
      # bbox_pred needed for gradient computation has been modified
      # by F.relu(bbox_pred) when run with PyTorch 1.10. So replace
      # F.relu(bbox_pred) with bbox_pred.clamp(min=0)
      bbox_pred = bbox_pred.clamp(min=0)
      bbox_pred *= stride
      return cls_score, bbox_pred, centerness
  
imports: from typing import Dict, List, Sequence, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import Scale
  from mmengine.model import bias_init_with_prob, normal_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import bbox_overlaps
  from mmdet.utils import InstanceList, OptInstanceList, reduce_mean
  from ..task_modules.prior_generators import MlvlPointGenerator
  from ..utils import levels_to_images, multi_apply
  from .fcos_head import FCOSHead
label_desc: Use image node_id 3 for calling the AutoAssignHead obj's underlying member method code with example usage: obj.forward_single(x, scale, stride) and returns: cls_score,  bbox_pred,  centerness