docstr: Deformable convolution from :paper:`deformconv`.
  
  Arguments are similar to :class:`Conv2D`. Extra arguments:
  
  Args:
      deformable_groups (int): number of groups used in deformable convolution.
      norm (nn.Module, optional): a normalization layer
      activation (callable(Tensor) -> Tensor): a callable activation function
docstr_tok: ["Deformable","convolution","from",":","paper",":","`","deformconv","`",".","Arguments","are","similar","to",":","class",":","`","Conv2D","`",".","Extra","arguments",":","Args",":","deformable_groups","(","int",")",":","number","of","groups","used","in","deformable","convolution",".","norm","(","nn.Module",",","optional",")",":","a","normalization","layer","activation","(","callable","(","Tensor",")","-",">","Tensor",")",":","a","callable","activation","function"]
code: def __init__(
      self,
      in_channels,
      out_channels,
      kernel_size,
      stride=1,
      padding=0,
      dilation=1,
      groups=1,
      deformable_groups=1,
      bias=False,
      norm=None,
      activation=None,
  ):
      """
      Deformable convolution from :paper:`deformconv`.
  
      Arguments are similar to :class:`Conv2D`. Extra arguments:
  
      Args:
          deformable_groups (int): number of groups used in deformable convolution.
          norm (nn.Module, optional): a normalization layer
          activation (callable(Tensor) -> Tensor): a callable activation function
      """
      super(DeformConv, self).__init__()
  
      assert not bias
      assert (
          in_channels % groups == 0
      ), "in_channels {} cannot be divisible by groups {}".format(
          in_channels, groups
      )
      assert (
          out_channels % groups == 0
      ), "out_channels {} cannot be divisible by groups {}".format(
          out_channels, groups
      )
  
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.kernel_size = _pair(kernel_size)
      self.stride = _pair(stride)
      self.padding = _pair(padding)
      self.dilation = _pair(dilation)
      self.groups = groups
      self.deformable_groups = deformable_groups
      self.norm = norm
      self.activation = activation
  
      self.weight = nn.Parameter(
          torch.Tensor(
              out_channels,
              in_channels // self.groups,
              *self.kernel_size,
          )
      )
      self.bias = None
  
      nn.init.kaiming_uniform_(self.weight, nonlinearity="relu")
  
imports: import math
  from functools import lru_cache
  import torch
  from torch import nn
  from torch.autograd import Function
  from torch.autograd.function import once_differentiable
  from torch.nn.modules.utils import _pair
  from torchvision.ops import deform_conv2d
  from detectron2.utils.develop import create_dummy_class, create_dummy_func
  from .wrappers import _NewEmptyTensorOp
label_desc: Use image node_id 1 to create a new DeformConv object from inherited base classes: nn with example: obj = DeformConv(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, deformable_groups, bias, norm, activation)