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: Compute regression targets and each point inside or outside gt_bbox
  for a single image.
  
  Args:
      gt_instances (:obj:`InstanceData`): Ground truth of instance
          annotations. It should includes ``bboxes`` and ``labels``
          attributes.
      points (Tensor): Points of all fpn level, has shape
          (num_points, 2).
  
  Returns:
      tuple[Tensor, Tensor]: Containing the following Tensors:
  
      - inside_gt_bbox_mask (Tensor): Bool tensor with shape             (num_points, num_gt), each value is used to mark whether this             point falls within a certain gt.
      - bbox_targets (Tensor): BBox targets of each points with each             gt_bboxes, has shape (num_points, num_gt, 4).
docstr_tok: ["Compute","regression","targets","and","each","point","inside","or","outside","gt_bbox","for","a","single","image",".","Args",":","gt_instances","(",":","obj",":","`","InstanceData","`",")",":","Ground","truth","of","instance","annotations",".","It","should","includes","``","bboxes","``","and","``","labels","``","attributes",".","points","(","Tensor",")",":","Points","of","all","fpn","level",",","has","shape","(","num_points",",","2",")",".","Returns",":","tuple","[","Tensor",",","Tensor","]",":","Containing","the","following","Tensors",":","-","inside_gt_bbox_mask","(","Tensor",")",":","Bool","tensor","with","shape","(","num_points",",","num_gt",")",",","each","value","is","used","to","mark","whether","this","point","falls","within","a","certain","gt",".","-","bbox_targets","(","Tensor",")",":","BBox","targets","of","each","points","with","each","gt_bboxes",",","has","shape","(","num_points",",","num_gt",",","4",")","."]
code: def _get_targets_single(
      self, gt_instances: InstanceData, points: Tensor
  ) -> Tuple[Tensor, Tensor]:
      """Compute regression targets and each point inside or outside gt_bbox
          for a single image.
  
          Args:
              gt_instances (:obj:`InstanceData`): Ground truth of instance
                  annotations. It should includes ``bboxes`` and ``labels``
                  attributes.
              points (Tensor): Points of all fpn level, has shape
                  (num_points, 2).
  
          Returns:
              tuple[Tensor, Tensor]: Containing the following Tensors:
  
              - inside_gt_bbox_mask (Tensor): Bool tensor with shape \
              (num_points, num_gt), each value is used to mark whether this \
              point falls within a certain gt.
              - bbox_targets (Tensor): BBox targets of each points with each \
              gt_bboxes, has shape (num_points, num_gt, 4).
          """
      gt_bboxes = gt_instances.bboxes
      num_points = points.size(0)
      num_gts = gt_bboxes.size(0)
      gt_bboxes = gt_bboxes[None].expand(num_points, num_gts, 4)
      xs, ys = points[:, 0], points[:, 1]
      xs = xs[:, None]
      ys = ys[:, None]
      left = xs - gt_bboxes[..., 0]
      right = gt_bboxes[..., 2] - xs
      top = ys - gt_bboxes[..., 1]
      bottom = gt_bboxes[..., 3] - ys
      bbox_targets = torch.stack((left, top, right, bottom), -1)
      if num_gts:
          inside_gt_bbox_mask = bbox_targets.min(-1)[0] > 0
      else:
          inside_gt_bbox_mask = bbox_targets.new_zeros(
              (num_points, num_gts), dtype=torch.bool
          )
  
      return inside_gt_bbox_mask, bbox_targets
  
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 8 for calling the AutoAssignHead obj's underlying member method code with example usage: obj._get_targets_single(gt_instances, points) and returns: inside_gt_bbox_mask,  bbox_targets