class_docstr: Feature Adaption Module.
  
  Feature Adaption Module is implemented based on DCN v1.
  It uses anchor shape prediction rather than feature map to
  predict offsets of deform conv layer.
  
  Args:
      in_channels (int): Number of channels in the input feature map.
      out_channels (int): Number of channels in the output feature map.
      kernel_size (int): Deformable conv kernel size. Defaults to 3.
      deform_groups (int): Deformable conv group size. Defaults to 4.
      init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or             list[dict], optional): Initialization config dict.
class_docstr_tok: ["Feature","Adaption","Module",".","Feature","Adaption","Module","is","implemented","based","on","DCN","v1",".","It","uses","anchor","shape","prediction","rather","than","feature","map","to","predict","offsets","of","deform","conv","layer",".","Args",":","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","out_channels","(","int",")",":","Number","of","channels","in","the","output","feature","map",".","kernel_size","(","int",")",":","Deformable","conv","kernel","size",".","Defaults","to","3.","deform_groups","(","int",")",":","Deformable","conv","group","size",".","Defaults","to","4.","init_cfg","(",":","obj",":","`","ConfigDict","`","or","list","[",":","obj",":","`","ConfigDict","`","]","or","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict","."]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      kernel_size: int = 3,
      deform_groups: int = 4,
      init_cfg: MultiConfig = dict(
          type="Normal",
          layer="Conv2d",
          std=0.1,
          override=dict(type="Normal", name="conv_adaption", std=0.01),
      ),
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      offset_channels = kernel_size * kernel_size * 2
      self.conv_offset = nn.Conv2d(
          2, deform_groups * offset_channels, 1, bias=False
      )
      self.conv_adaption = DeformConv2d(
          in_channels,
          out_channels,
          kernel_size=kernel_size,
          padding=(kernel_size - 1) // 2,
          deform_groups=deform_groups,
      )
      self.relu = nn.ReLU(inplace=True)
  
imports: from typing import List, Optional, Tuple
  import torch
  import torch.nn
  from mmcv.ops import DeformConv2d, MaskedConv2d
  from mmengine.model import BaseModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType, OptInstanceList
  from ..layers import multiclass_nms
  from ..task_modules.prior_generators import anchor_inside_flags, calc_region
  from ..task_modules.samplers import PseudoSampler
  from ..utils import images_to_levels, multi_apply, unmap
  from .anchor_head import AnchorHead
label_desc: Use image node_id 1 to create a new FeatureAdaption object from inherited base classes: BaseModule with example: obj = FeatureAdaption(in_channels, out_channels, kernel_size, deform_groups, init_cfg)