class_docstr: AdaptiveConv used to adapt the sampling location with the anchors.
  
  Args:
      in_channels (int): Number of channels in the input image.
      out_channels (int): Number of channels produced by the convolution.
      kernel_size (int or tuple[int]): Size of the conv kernel.
          Defaults to 3.
      stride (int or tuple[int]): Stride of the convolution. Defaults to 1.
      padding (int or tuple[int]): Zero-padding added to both sides of
          the input. Defaults to 1.
      dilation (int or tuple[int]): Spacing between kernel elements.
          Defaults to 3.
      groups (int): Number of blocked connections from input channels to
          output channels. Defaults to 1.
      bias (bool): If set True, adds a learnable bias to the output.
          Defaults to False.
      adapt_type (str): Type of adaptive conv, can be either ``offset``
          (arbitrary anchors) or 'dilation' (uniform anchor).
          Defaults to 'dilation'.
      init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or             list[dict]): Initialization config dict.
class_docstr_tok: ["AdaptiveConv","used","to","adapt","the","sampling","location","with","the","anchors",".","Args",":","in_channels","(","int",")",":","Number","of","channels","in","the","input","image",".","out_channels","(","int",")",":","Number","of","channels","produced","by","the","convolution",".","kernel_size","(","int","or","tuple","[","int","]",")",":","Size","of","the","conv","kernel",".","Defaults","to","3.","stride","(","int","or","tuple","[","int","]",")",":","Stride","of","the","convolution",".","Defaults","to","1.","padding","(","int","or","tuple","[","int","]",")",":","Zero-padding","added","to","both","sides","of","the","input",".","Defaults","to","1.","dilation","(","int","or","tuple","[","int","]",")",":","Spacing","between","kernel","elements",".","Defaults","to","3.","groups","(","int",")",":","Number","of","blocked","connections","from","input","channels","to","output","channels",".","Defaults","to","1.","bias","(","bool",")",":","If","set","True",",","adds","a","learnable","bias","to","the","output",".","Defaults","to","False",".","adapt_type","(","str",")",":","Type","of","adaptive","conv",",","can","be","either","``","offset","``","(","arbitrary","anchors",")","or","'dilation","'","(","uniform","anchor",")",".","Defaults","to","'dilation","'",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","list","[",":","obj",":","`","ConfigDict","`","]","or","dict","or","list","[","dict","]",")",":","Initialization","config","dict","."]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      kernel_size: Union[int, Tuple[int]] = 3,
      stride: Union[int, Tuple[int]] = 1,
      padding: Union[int, Tuple[int]] = 1,
      dilation: Union[int, Tuple[int]] = 3,
      groups: int = 1,
      bias: bool = False,
      adapt_type: str = "dilation",
      init_cfg: MultiConfig = dict(
          type="Normal", std=0.01, override=dict(name="conv")
      ),
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      assert adapt_type in ["offset", "dilation"]
      self.adapt_type = adapt_type
  
      assert kernel_size == 3, "Adaptive conv only supports kernels 3"
      if self.adapt_type == "offset":
          assert stride == 1 and padding == 1 and groups == 1, (
              "Adaptive conv offset mode only supports padding: {1}, "
              f"stride: {1}, groups: {1}"
          )
          self.conv = DeformConv2d(
              in_channels,
              out_channels,
              kernel_size,
              padding=padding,
              stride=stride,
              groups=groups,
              bias=bias,
          )
      else:
          self.conv = nn.Conv2d(
              in_channels,
              out_channels,
              kernel_size,
              padding=dilation,
              dilation=dilation,
          )
  
imports: from __future__ import division
  import copy
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from mmcv.ops import DeformConv2d
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule, ModuleList
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures import SampleList
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptInstanceList, OptMultiConfig
  from ..task_modules.assigners import RegionAssigner
  from ..task_modules.samplers import PseudoSampler
  from ..utils import images_to_levels, multi_apply, select_single_mlvl, unpack_gt_instances
  from .base_dense_head import BaseDenseHead
  from .rpn_head import RPNHead
label_desc: Use image node_id 1 to create a new AdaptiveConv object from inherited base classes: BaseModule with example: obj = AdaptiveConv(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias, adapt_type, init_cfg)