code: def deformable_convolution(
      inp,
      outmaps,
      kernel,
      offset,
      mask=None,
      pad=None,
      stride=None,
      dilation=None,
      group=1,
      deformable_group=1,
      channel_last=False,
      w_init=None,
      b_init=None,
      base_axis=1,
      fix_parameters=False,
      rng=None,
      with_bias=True,
      apply_w=None,
      apply_b=None,
  ):
      """2D Deformable Convolution with a bias term. If use mask, this function is Deformable Convolution v2.
  
      - Dai et al., Deformable Convolutional Networks. https://arxiv.org/abs/1703.06211
      - Zhu et al., Deformable ConvNets v2: More Deformable, Better Results. https://arxiv.org/abs/1811.11168
  
  
      Args:
          inp (~nnabla.Variable): N-D array.
          outmaps (int): Number of convolution kernels (which is equal to the number of output channels). For example, to apply convolution on an input with 16 types of filters, specify 16.
          kernel (:obj:`tuple` of :obj:`int`): Convolution kernel size. For example, to apply convolution on an image with a 3 (height) by 5 (width) two-dimensional kernel, specify (3,5).
          offset (~nnabla.Variable): Offsets for deformable convolutions. Shape is fixed to :math:`(N, deformable{\_}group \\times 2 \\times Kh \\times Kw, H, W)`. Offsets must be calculated externally through a separate convolution layer.
          mask (~nnabla.Variable): Normalized mask for deformable convolutions v2. Shape is fixed to :math:`(N, deformable{\_}group \\times Kh \\times Kw, H, W)`. Masks must be calculated externally together with the offsets through a separate convolution layer.
          pad (:obj:`tuple` of :obj:`int`): Padding sizes for dimensions.
          stride (:obj:`tuple` of :obj:`int`): Stride sizes for dimensions.
          dilation (:obj:`tuple` of :obj:`int`): Dilation sizes for dimensions.
          group (int): Number of groups of channels. This makes connections across channels more sparse by grouping connections along map direction.
          deformable_group (int): Number of deformable groups of channels. This makes connections across channels more sparse by grouping connections along map direction.
          channel_last (bool): If True, the last dimension is considered as channel dimension, a.k.a. NHWC order.
          w_init (:obj:`nnabla.initializer.BaseInitializer` or :obj:`numpy.ndarray`): Initializer for weight. By default, it is initialized with :obj:`nnabla.initializer.UniformInitializer` within the range determined by :obj:`nnabla.initializer.calc_uniform_lim_glorot`.
          b_init (:obj:`nnabla.initializer.BaseInitializer` or :obj:`numpy.ndarray`): Initializer for bias. By default, it is initialized with zeros if `with_bias` is `True`.
          base_axis (int): Dimensions up to `base_axis` are treated as the sample dimensions.
          fix_parameters (bool): When set to `True`, the weights and biases will not be updated.
          rng (numpy.random.RandomState): Random generator for Initializer.
          with_bias (bool): Specify whether to include the bias term.
          apply_w (function): Lambda, function, or callable object applied to the weights.
          apply_b (function): Lambda, function, or callable object applied to the bias.
  
      Returns:
          :class:`~nnabla.Variable`: N-D array. See :obj:`~nnabla.functions.convolution` for the output shape.
  
      """
      if channel_last:
          channels = inp.shape[-1]
          filter_shape = tuple(kernel) + (channels // group,)
      else:
          channels = inp.shape[base_axis]
          filter_shape = (channels // group,) + tuple(kernel)
      if w_init is None:
          w_init = UniformInitializer(
              calc_uniform_lim_glorot(channels, outmaps, tuple(kernel)),
              rng=rng,
          )
      if with_bias and b_init is None:
          b_init = ConstantInitializer()
      w = get_parameter_or_create(
          "W",
          (outmaps,) + filter_shape,
          w_init,
          True,
          not fix_parameters,
      )
      if apply_w is not None:
          w = apply_w(w)
      b = None
      if with_bias:
          b = get_parameter_or_create(
              "b", (outmaps,), b_init, True, not fix_parameters
          )
          if apply_b is not None:
              b = apply_b(b)
      return F.deformable_convolution(
          inp,
          w,
          offset,
          mask,
          b,
          base_axis,
          pad,
          stride,
          dilation,
          group,
          deformable_group,
          channel_last,
      )
  
imports: from six import exec_
  import numpy
  import nnabla
  import nnabla.functions
  from nnabla.parameter import get_parameter_or_create, get_parameter
  from nnabla.initializer import calc_uniform_lim_glorot, ConstantInitializer, NormalInitializer, UniformInitializer, WeightNormalizationScaleInitializer
label_desc: Use image node_id 13 for calling a global function with example usage: deformable_convolution(inp, outmaps, kernel, offset, mask, pad, stride, dilation, group, deformable_group, channel_last, w_init, b_init, base_axis, fix_parameters, rng, with_bias, apply_w, apply_b) and returns: F