class_docstr: SOLO mask head used in `SOLO: Segmenting Objects by Locations.
  
  <https://arxiv.org/abs/1912.04488>`_
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      feat_channels (int): Number of hidden channels. Used in child classes.
          Defaults to 256.
      stacked_convs (int): Number of stacking convs of the head.
          Defaults to 4.
      strides (tuple): Downsample factor of each feature map.
      scale_ranges (tuple[tuple[int, int]]): Area range of multiple
          level masks, in the format [(min1, max1), (min2, max2), ...].
          A range of (16, 64) means the area range between (16, 64).
      pos_scale (float): Constant scale factor to control the center region.
      num_grids (list[int]): Divided image into a uniform grids, each
          feature map has a different grid value. The number of output
          channels is grid ** 2. Defaults to [40, 36, 24, 16, 12].
      cls_down_index (int): The index of downsample operation in
          classification branch. Defaults to 0.
      loss_mask (dict): Config of mask loss.
      loss_cls (dict): Config of classification loss.
      norm_cfg (dict): Dictionary to construct and config norm layer.
          Defaults to norm_cfg=dict(type='GN', num_groups=32,
          requires_grad=True).
      train_cfg (dict): Training config of head.
      test_cfg (dict): Testing config of head.
      init_cfg (dict or list[dict], optional): Initialization config dict.
docstr: Initialize layers of the head.
code: def _init_layers(self) -> None:
      """Initialize layers of the head."""
      self.mask_convs = nn.ModuleList()
      self.cls_convs = nn.ModuleList()
      for i in range(self.stacked_convs):
          chn = self.in_channels + 2 if i == 0 else self.feat_channels
          self.mask_convs.append(
              ConvModule(
                  chn,
                  self.feat_channels,
                  3,
                  stride=1,
                  padding=1,
                  norm_cfg=self.norm_cfg,
              )
          )
          chn = self.in_channels if i == 0 else self.feat_channels
          self.cls_convs.append(
              ConvModule(
                  chn,
                  self.feat_channels,
                  3,
                  stride=1,
                  padding=1,
                  norm_cfg=self.norm_cfg,
              )
          )
      self.conv_mask_list = nn.ModuleList()
      for num_grid in self.num_grids:
          self.conv_mask_list.append(
              nn.Conv2d(self.feat_channels, num_grid**2, 1)
          )
  
      self.conv_cls = nn.Conv2d(
          self.feat_channels, self.cls_out_channels, 3, padding=1
      )
  
imports: from typing import List, Optional, Tuple
  import mmcv
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.utils.misc import floordiv
  from mmdet.registry import MODELS
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType
  from ..layers import mask_matrix_nms
  from ..utils import center_of_mass, generate_coordinate, multi_apply
  from .base_mask_head import BaseMaskHead
label_desc: Use image node_id 2 for calling the SOLOHead obj's underlying member method code with example usage: obj._init_layers() without return types