class_docstr: Implementation of RPN head.
  
  Args:
      in_channels (int): Number of channels in the input feature map.
      num_classes (int): Number of categories excluding the background
          category. Defaults to 1.
      init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or             list[dict]): Initialization config dict.
      num_convs (int): Number of convolution layers in the head.
          Defaults to 1.
docstr: Initialize layers of the head.
docstr_tok: ["Initialize","layers","of","the","head","."]
code: def _init_layers(self) -> None:
      """Initialize layers of the head."""
      if self.num_convs > 1:
          rpn_convs = []
          for i in range(self.num_convs):
              if i == 0:
                  in_channels = self.in_channels
              else:
                  in_channels = self.feat_channels
              # use ``inplace=False`` to avoid error: one of the variables
              # needed for gradient computation has been modified by an
              # inplace operation.
              rpn_convs.append(
                  ConvModule(
                      in_channels,
                      self.feat_channels,
                      3,
                      padding=1,
                      inplace=False,
                  )
              )
          self.rpn_conv = nn.Sequential(*rpn_convs)
      else:
          self.rpn_conv = nn.Conv2d(
              self.in_channels, self.feat_channels, 3, padding=1
          )
      self.rpn_cls = nn.Conv2d(
          self.feat_channels,
          self.num_base_priors * self.cls_out_channels,
          1,
      )
      reg_dim = self.bbox_coder.encode_size
      self.rpn_reg = nn.Conv2d(
          self.feat_channels, self.num_base_priors * reg_dim, 1
      )
  
imports: import copy
  from typing import List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule
  from mmcv.ops import batched_nms
  from mmengine.config import ConfigDict
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import cat_boxes, empty_box_as, get_box_tensor, get_box_wh, scale_boxes
  from mmdet.utils import InstanceList, MultiConfig, OptInstanceList
  from .anchor_head import AnchorHead
label_desc: Use image node_id 2 for calling the RPNHead obj's underlying member method code with example usage: obj._init_layers() without return types