class_docstr: CondInst mask feature map branch used in     https://arxiv.org/abs/1904.02689.
  
  Args:
      in_channels (int): Number of channels in the input feature map.
      feat_channels (int): Number of hidden channels of the mask feature
           map branch.
      start_level (int): The starting feature map level from RPN that
           will be used to predict the mask feature map.
      end_level (int): The ending feature map level from rpn that
           will be used to predict the mask feature map.
      out_channels (int): Number of output channels of the mask feature
           map branch. This is the channel count of the mask
           feature map that to be dynamically convolved with the predicted
           kernel.
      mask_stride (int): Downsample factor of the mask feature map output.
          Defaults to 4.
      num_stacked_convs (int): Number of convs in mask feature branch.
      conv_cfg (dict): Config dict for convolution layer. Default: None.
      norm_cfg (dict): Config dict for normalization layer. Default: None.
      init_cfg (dict or list[dict], optional): Initialization config dict.
class_docstr_tok: ["CondInst","mask","feature","map","branch","used","in","https",":","\/\/arxiv.org\/abs\/1904.02689",".","Args",":","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","feat_channels","(","int",")",":","Number","of","hidden","channels","of","the","mask","feature","map","branch",".","start_level","(","int",")",":","The","starting","feature","map","level","from","RPN","that","will","be","used","to","predict","the","mask","feature","map",".","end_level","(","int",")",":","The","ending","feature","map","level","from","rpn","that","will","be","used","to","predict","the","mask","feature","map",".","out_channels","(","int",")",":","Number","of","output","channels","of","the","mask","feature","map","branch",".","This","is","the","channel","count","of","the","mask","feature","map","that","to","be","dynamically","convolved","with","the","predicted","kernel",".","mask_stride","(","int",")",":","Downsample","factor","of","the","mask","feature","map","output",".","Defaults","to","4.","num_stacked_convs","(","int",")",":","Number","of","convs","in","mask","feature","branch",".","conv_cfg","(","dict",")",":","Config","dict","for","convolution","layer",".","Default",":","None",".","norm_cfg","(","dict",")",":","Config","dict","for","normalization","layer",".","Default",":","None",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict","."]
docstr: Initialize layers of the head.
docstr_tok: ["Initialize","layers","of","the","head","."]
code: def _init_layers(self) -> None:
      """Initialize layers of the head."""
      self.convs_all_levels = nn.ModuleList()
      for i in range(self.start_level, self.end_level + 1):
          convs_per_level = nn.Sequential()
          convs_per_level.add_module(
              f"conv{i}",
              ConvModule(
                  self.in_channels,
                  self.feat_channels,
                  3,
                  padding=1,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
                  inplace=False,
                  bias=False,
              ),
          )
          self.convs_all_levels.append(convs_per_level)
  
      conv_branch = []
      for _ in range(self.num_stacked_convs):
          conv_branch.append(
              ConvModule(
                  self.feat_channels,
                  self.feat_channels,
                  3,
                  padding=1,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
                  bias=False,
              )
          )
      self.conv_branch = nn.Sequential(*conv_branch)
  
      self.conv_pred = nn.Conv2d(
          self.feat_channels, self.out_channels, 1, stride=1
      )
  
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 2 for calling the MaskFeatModule obj's underlying member method code with example usage: obj._init_layers() without return types