code: def forward(
      ctx,
      input,
      offset,
      weight,
      stride=1,
      padding=0,
      dilation=1,
      groups=1,
      deformable_groups=1,
      im2col_step=64,
  ):
      if input is not None and input.dim() != 4:
          raise ValueError(
              "Expected 4D tensor as input, got {}D tensor instead.".format(
                  input.dim()
              )
          )
      ctx.stride = _pair(stride)
      ctx.padding = _pair(padding)
      ctx.dilation = _pair(dilation)
      ctx.groups = groups
      ctx.deformable_groups = deformable_groups
      ctx.im2col_step = im2col_step
  
      ctx.save_for_backward(input, offset, weight)
  
      output = input.new_empty(
          DeformConvFunction._output_size(
              input, weight, ctx.padding, ctx.dilation, ctx.stride
          )
      )
  
      ctx.bufs_ = [
          input.new_empty(0),
          input.new_empty(0),
      ]  # columns, ones
  
      cur_im2col_step = min(ctx.im2col_step, input.shape[0])
      assert (
          input.shape[0] % cur_im2col_step
      ) == 0, "im2col step must divide batchsize"
      if not input.is_cuda and dcn_cpu_ready:
          deform_conv_cpu.deform_conv_forward_cpu(
              input,
              weight,
              offset,
              output,
              ctx.bufs_[0],
              ctx.bufs_[1],
              weight.size(3),
              weight.size(2),
              ctx.stride[1],
              ctx.stride[0],
              ctx.padding[1],
              ctx.padding[0],
              ctx.dilation[1],
              ctx.dilation[0],
              ctx.groups,
              ctx.deformable_groups,
              cur_im2col_step,
          )
      elif input.is_cuda and dcn_cuda_ready:
          deform_conv_cuda.deform_conv_forward_cuda(
              input,
              weight,
              offset,
              output,
              ctx.bufs_[0],
              ctx.bufs_[1],
              weight.size(3),
              weight.size(2),
              ctx.stride[1],
              ctx.stride[0],
              ctx.padding[1],
              ctx.padding[0],
              ctx.dilation[1],
              ctx.dilation[0],
              ctx.groups,
              ctx.deformable_groups,
              cur_im2col_step,
          )
      else:
          device_ = input.device.type
          raise RuntimeError(
              "Input type is {}, but 'deform_conv_{}.*.so' is not imported successfully.".format(
                  device_, device_
              ),
          )
  
      return output
  
file_path: EasyOCR/easyocr/DBNet/assets/ops/dcn/functions/deform_conv.py
imports: import os
  import torch
  import warnings
  from torch.autograd import Function
  from torch.nn.modules.utils import _pair
  from torch.utils import cpp_extension
label_desc: Use image node_id 1 for calling the DeformConvFunction obj's underlying member method code with example usage: obj.forward(ctx, input, offset, weight, stride, padding, dilation, groups, deformable_groups, im2col_step) and returns: output