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: Initialize layers of the head.
code: def _init_layers(self) -> None:
      """Initialize layers of the head."""
      super()._init_layers()
      # a branch to predict kernels of dynamic convs
      self.kernel_convs = nn.ModuleList()
      # calculate num dynamic parameters
      weight_nums, bias_nums = [], []
      for i in range(self.num_dyconvs):
          if i == 0:
              weight_nums.append(
                  # mask prototype and coordinate features
                  (self.num_prototypes + 2)
                  * self.dyconv_channels
              )
              bias_nums.append(self.dyconv_channels * 1)
          elif i == self.num_dyconvs - 1:
              weight_nums.append(self.dyconv_channels * 1)
              bias_nums.append(1)
          else:
              weight_nums.append(
                  self.dyconv_channels * self.dyconv_channels
              )
              bias_nums.append(self.dyconv_channels * 1)
      self.weight_nums = weight_nums
      self.bias_nums = bias_nums
      self.num_gen_params = sum(weight_nums) + sum(bias_nums)
  
      for i in range(self.stacked_convs):
          chn = self.in_channels if i == 0 else self.feat_channels
          self.kernel_convs.append(
              ConvModule(
                  chn,
                  self.feat_channels,
                  3,
                  stride=1,
                  padding=1,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
                  act_cfg=self.act_cfg,
              )
          )
      pred_pad_size = self.pred_kernel_size // 2
      self.rtm_kernel = nn.Conv2d(
          self.feat_channels,
          self.num_gen_params,
          self.pred_kernel_size,
          padding=pred_pad_size,
      )
      self.mask_head = MaskFeatModule(
          in_channels=self.in_channels,
          feat_channels=self.feat_channels,
          stacked_convs=4,
          num_levels=len(self.prior_generator.strides),
          num_prototypes=self.num_prototypes,
          act_cfg=self.act_cfg,
          norm_cfg=self.norm_cfg,
      )
  
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 2 for calling the RTMDetInsHead obj's underlying member method code with example usage: obj._init_layers() without return types