class_docstr: Detection Head of RTMDet-Ins.
  
  Args:
      num_prototypes (int): Number of mask prototype features extracted
          from the mask head. Defaults to 8.
      dyconv_channels (int): Channel of the dynamic conv layers.
          Defaults to 8.
      num_dyconvs (int): Number of the dynamic convolution layers.
          Defaults to 3.
      mask_loss_stride (int): Down sample stride of the masks for loss
          computation. Defaults to 4.
      loss_mask (:obj:`ConfigDict` or dict): Config dict for mask loss.
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.
      - kernel_preds (list[Tensor]): Dynamic conv kernels for all scale
        levels, each is a 4D-tensor, the channels number is
        num_gen_params.
      - mask_feat (Tensor): Output feature of the mask head. Each is a
        4D-tensor, the channels number is num_prototypes.
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.
          - kernel_preds (list[Tensor]): Dynamic conv kernels for all scale
            levels, each is a 4D-tensor, the channels number is
            num_gen_params.
          - mask_feat (Tensor): Output feature of the mask head. Each is a
            4D-tensor, the channels number is num_prototypes.
      """
      mask_feat = self.mask_head(feats)
  
      cls_scores = []
      bbox_preds = []
      kernel_preds = []
      for idx, (x, scale, stride) in enumerate(
          zip(feats, self.scales, self.prior_generator.strides)
      ):
          cls_feat = x
          reg_feat = x
          kernel_feat = x
  
          for cls_layer in self.cls_convs:
              cls_feat = cls_layer(cls_feat)
          cls_score = self.rtm_cls(cls_feat)
  
          for kernel_layer in self.kernel_convs:
              kernel_feat = kernel_layer(kernel_feat)
          kernel_pred = self.rtm_kernel(kernel_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)) * stride[0]
  
          cls_scores.append(cls_score)
          bbox_preds.append(reg_dist)
          kernel_preds.append(kernel_pred)
      return (
          tuple(cls_scores),
          tuple(bbox_preds),
          tuple(kernel_preds),
          mask_feat,
      )
  
imports: import copy
  import math
  from typing import List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, is_norm
  from mmcv.ops import batched_nms
  from mmengine.model import BaseModule, bias_init_with_prob, constant_init, normal_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.layers.transformer import inverse_sigmoid
  from mmdet.models.utils import filter_scores_and_topk, multi_apply, select_single_mlvl, sigmoid_geometric_mean
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import cat_boxes, distance2bbox, get_box_tensor, get_box_wh, scale_boxes
  from mmdet.utils import ConfigType, InstanceList, OptInstanceList, reduce_mean
  from .rtmdet_head import RTMDetHead
label_desc: Use image node_id 3 for calling the RTMDetInsHead obj's underlying member method code with example usage: obj.forward(feats) and returns: tuple,  tuple,  tuple,  mask_feat