class_docstr: CondInst box head used in https://arxiv.org/abs/1904.02689.
  
  Note that CondInst Bbox Head is a extension of FCOS head.
  Two differences are described as follows:
  
  1. CondInst box head predicts a set of params for each instance.
  2. CondInst box head return the pos_gt_inds and pos_inds.
  
  Args:
      num_params (int): Number of params for instance segmentation.
class_docstr_tok: ["CondInst","box","head","used","in","https",":","\/\/arxiv.org\/abs\/1904.02689",".","Note","that","CondInst","Bbox","Head","is","a","extension","of","FCOS","head",".","Two","differences","are","described","as","follows",":","1",".","CondInst","box","head","predicts","a","set","of","params","for","each","instance",".","2",".","CondInst","box","head","return","the","pos_gt_inds","and","pos_inds",".","Args",":","num_params","(","int",")",":","Number","of","params","for","instance","segmentation","."]
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: scores for each class, bbox predictions, centerness
      predictions and param 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",":","scores","for","each","class",",","bbox","predictions",",","centerness","predictions","and","param","predictions","of","input","feature","maps","."]
code: def forward_single(
      self, x: Tensor, scale: Scale, stride: int
  ) -> Tuple[Tensor, 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: scores for each class, bbox predictions, centerness
          predictions and param predictions of input feature maps.
      """
      cls_score, bbox_pred, cls_feat, reg_feat = super(
          FCOSHead, self
      ).forward_single(x)
      if self.centerness_on_reg:
          centerness = self.conv_centerness(reg_feat)
      else:
          centerness = self.conv_centerness(cls_feat)
      # scale the bbox_pred of different level
      # float to avoid overflow when enabling FP16
      bbox_pred = scale(bbox_pred).float()
      if self.norm_on_bbox:
          # 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)
          if not self.training:
              bbox_pred *= stride
      else:
          bbox_pred = bbox_pred.exp()
      param_pred = self.controller(reg_feat)
      return cls_score, bbox_pred, centerness, param_pred
  
imports: import copy
  from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, Scale
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule, kaiming_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import cat_boxes
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType, OptInstanceList, reduce_mean
  from ..task_modules.prior_generators import MlvlPointGenerator
  from ..utils import aligned_bilinear, filter_scores_and_topk, multi_apply, relative_coordinate_maps, select_single_mlvl
  from ..utils.misc import empty_instances
  from .base_mask_head import BaseMaskHead
  from .fcos_head import FCOSHead
label_desc: Use image node_id 3 for calling the CondInstBboxHead obj's underlying member method code with example usage: obj.forward_single(x, scale, stride) and returns: cls_score,  bbox_pred,  centerness,  param_pred