class_docstr: Feature Align Module.
  
  Feature Align 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): Size of the convolution kernel.
          ``norm_cfg=dict(type='GN', num_groups=32, requires_grad=True)``.
      deform_groups: (int): Group number of DCN in
          FeatureAdaption module.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict], optional): Initialization config dict.
class_docstr_tok: ["Feature","Align","Module",".","Feature","Align","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",")",":","Size","of","the","convolution","kernel",".","``","norm_cfg=dict","(","type='GN","'",",","num_groups=32",",","requires_grad=True",")","``",".","deform_groups",":","(","int",")",":","Group","number","of","DCN","in","FeatureAdaption","module",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",",","optional",")",":","Initialization","config","dict","."]
docstr: Forward function of feature align module.
  
  Args:
      x (Tensor): Features from the upstream network.
      shape (Tensor): Exponential of bbox predictions.
  
  Returns:
      x (Tensor): The aligned features.
docstr_tok: ["Forward","function","of","feature","align","module",".","Args",":","x","(","Tensor",")",":","Features","from","the","upstream","network",".","shape","(","Tensor",")",":","Exponential","of","bbox","predictions",".","Returns",":","x","(","Tensor",")",":","The","aligned","features","."]
code: def forward(self, x: Tensor, shape: Tensor) -> Tensor:
      """Forward function of feature align module.
  
      Args:
          x (Tensor): Features from the upstream network.
          shape (Tensor): Exponential of bbox predictions.
  
      Returns:
          x (Tensor): The aligned features.
      """
      offset = self.conv_offset(shape)
      x = self.relu(self.conv_adaption(x, offset))
      return x
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmcv.ops import DeformConv2d
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import InstanceList, OptInstanceList, OptMultiConfig
  from ..utils import filter_scores_and_topk, multi_apply
  from .anchor_free_head import AnchorFreeHead
label_desc: Use image node_id 2 for calling the FeatureAlign obj's underlying member method code with example usage: obj.forward(x, shape) and returns: x