class_docstr: ModulatedDeformConv2d with normalization layer used in DyHead.
  
  This module cannot be configured with `conv_cfg=dict(type='DCNv2')`
  because DyHead calculates offset and mask from middle-level feature.
  
  Args:
      in_channels (int): Number of input channels.
      out_channels (int): Number of output channels.
      stride (int | tuple[int], optional): Stride of the convolution.
          Default: 1.
      norm_cfg (dict, optional): Config dict for normalization layer.
          Default: dict(type='GN', num_groups=16, requires_grad=True).
class_docstr_tok: ["ModulatedDeformConv2d","with","normalization","layer","used","in","DyHead",".","This","module","can","not","be","configured","with","`","conv_cfg=dict","(","type='DCNv2","'",")","`","because","DyHead","calculates","offset","and","mask","from","middle-level","feature",".","Args",":","in_channels","(","int",")",":","Number","of","input","channels",".","out_channels","(","int",")",":","Number","of","output","channels",".","stride","(","int","|","tuple","[","int","]",",","optional",")",":","Stride","of","the","convolution",".","Default",":","1.","norm_cfg","(","dict",",","optional",")",":","Config","dict","for","normalization","layer",".","Default",":","dict","(","type='GN","'",",","num_groups=16",",","requires_grad=True",")","."]
docstr: Forward function.
docstr_tok: ["Forward","function","."]
code: def forward(self, x, offset, mask):
      """Forward function."""
      x = self.conv(x.contiguous(), offset, mask)
      if self.with_norm:
          x = self.norm(x)
      return x
  
file_path: mmdetection/mmdet/models/necks/dyhead.py
imports: import torch.nn
  import torch.nn.functional
  from mmcv.cnn import build_activation_layer, build_norm_layer
  from mmcv.ops.modulated_deform_conv import ModulatedDeformConv2d
  from mmengine.model import BaseModule, constant_init, normal_init
  from mmdet.registry import MODELS
  from ..layers import DyReLU
label_desc: Use image node_id 2 for calling the DyDCNv2 obj's underlying member method code with example usage: obj.forward(x, offset, mask) and returns: x