class_docstr: Detection Head of RTMDet.
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      with_objectness (bool): Whether to add an objectness branch.
          Defaults to True.
      act_cfg (:obj:`ConfigDict` or dict): Config dict for activation layer.
          Default: dict(type='ReLU')
class_docstr_tok: ["Detection","Head","of","RTMDet",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","with_objectness","(","bool",")",":","Whether","to","add","an","objectness","branch",".","Defaults","to","True",".","act_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","dict","for","activation","layer",".","Default",":","dict","(","type='ReLU","'",")"]
docstr: Forward features from the upstream network.
  
  Args:
      feats (tuple[Tensor]): Features from the upstream network, each is
          a 4D-tensor.
  
  Returns:
      tuple: Usually a tuple of classification scores and bbox prediction
      - cls_scores (list[Tensor]): Classification scores for all scale
        levels, each is a 4D-tensor, the channels number is
        num_base_priors * num_classes.
      - bbox_preds (list[Tensor]): Box energies / deltas for all scale
        levels, each is a 4D-tensor, the channels number is
        num_base_priors * 4.
docstr_tok: ["Forward","features","from","the","upstream","network",".","Args",":","feats","(","tuple","[","Tensor","]",")",":","Features","from","the","upstream","network",",","each","is","a","4D-tensor",".","Returns",":","tuple",":","Usually","a","tuple","of","classification","scores","and","bbox","prediction","-","cls_scores","(","list","[","Tensor","]",")",":","Classification","scores","for","all","scale","levels",",","each","is","a","4D-tensor",",","the","channels","number","is","num_base_priors","*","num_classes",".","-","bbox_preds","(","list","[","Tensor","]",")",":","Box","energies","\/","deltas","for","all","scale","levels",",","each","is","a","4D-tensor",",","the","channels","number","is","num_base_priors","*","4","."]
code: def forward(self, feats: Tuple[Tensor, ...]) -> tuple:
      """Forward features from the upstream network.
  
      Args:
          feats (tuple[Tensor]): Features from the upstream network, each is
              a 4D-tensor.
  
      Returns:
          tuple: Usually a tuple of classification scores and bbox prediction
          - cls_scores (list[Tensor]): Classification scores for all scale
            levels, each is a 4D-tensor, the channels number is
            num_base_priors * num_classes.
          - bbox_preds (list[Tensor]): Box energies / deltas for all scale
            levels, each is a 4D-tensor, the channels number is
            num_base_priors * 4.
      """
  
      cls_scores = []
      bbox_preds = []
      for idx, (x, scale, stride) in enumerate(
          zip(feats, self.scales, self.prior_generator.strides)
      ):
          cls_feat = x
          reg_feat = x
  
          for cls_layer in self.cls_convs:
              cls_feat = cls_layer(cls_feat)
          cls_score = self.rtm_cls(cls_feat)
  
          for reg_layer in self.reg_convs:
              reg_feat = reg_layer(reg_feat)
  
          if self.with_objectness:
              objectness = self.rtm_obj(reg_feat)
              cls_score = inverse_sigmoid(
                  sigmoid_geometric_mean(cls_score, objectness)
              )
  
          reg_dist = (
              scale(self.rtm_reg(reg_feat).exp()).float() * stride[0]
          )
  
          cls_scores.append(cls_score)
          bbox_preds.append(reg_dist)
      return tuple(cls_scores), tuple(bbox_preds)
  
imports: from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule, Scale, is_norm
  from mmengine.model import bias_init_with_prob, constant_init, normal_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures.bbox import distance2bbox
  from mmdet.utils import ConfigType, InstanceList, OptInstanceList, reduce_mean
  from ..layers.transformer import inverse_sigmoid
  from ..task_modules import anchor_inside_flags
  from ..utils import images_to_levels, multi_apply, sigmoid_geometric_mean, unmap
  from .atss_head import ATSSHead
label_desc: Use image node_id 4 for calling the RTMDetHead obj's underlying member method code with example usage: obj.forward(feats) and returns: tuple,  tuple