def METHOD_NAME(
    test_case, input, weight, offset, mask, bias, stride, padding, dilation
):
    torch_input = input.pytorch.detach().requires_grad_()
    torch_weight = weight.pytorch.detach().requires_grad_()
    torch_offset = offset.pytorch.detach().requires_grad_()
    torch_mask = mask.pytorch.detach().requires_grad_()
    torch_bias = bias.pytorch.detach().requires_grad_()
    torch_out = torchvision.ops.deform_conv2d(
        torch_input,
        torch_offset,
        torch_weight,
        stride=stride,
        padding=padding,
        dilation=dilation,
        mask=torch_mask,
        bias=torch_bias,
    )
    torch_out.sum().backward()
    flow_input = input.oneflow.detach().requires_grad_()
    flow_weight = weight.oneflow.detach().requires_grad_()
    flow_offset = offset.oneflow.detach().requires_grad_()
    flow_mask = mask.oneflow.detach().requires_grad_()
    flow_bias = bias.oneflow.detach().requires_grad_()
    flow_out = oneflow.nn.functional.deform_conv2d(
        flow_input,
        flow_offset,
        flow_weight,
        stride=stride,
        padding=padding,
        dilation=dilation,
        mask=flow_mask,
        bias=flow_bias,
    )
    flow_out.sum().backward()
    test_case.assertTrue(
        np.allclose(
            flow_input.grad.numpy(),
            torch_input.grad.cpu().numpy(),
            rtol=1e-2,
            atol=1e-2,
        )
    )
    test_case.assertTrue(
        np.allclose(
            flow_weight.grad.numpy(),
            torch_weight.grad.cpu().numpy(),
            rtol=1e-2,
            atol=1e-2,
        )
    )
    test_case.assertTrue(
        np.allclose(
            flow_offset.grad.numpy(),
            torch_offset.grad.cpu().numpy(),
            rtol=1e-2,
            atol=1e-2,
        )
    )
    test_case.assertTrue(
        np.allclose(
            flow_mask.grad.numpy(), torch_mask.grad.cpu().numpy(), rtol=1e-2, atol=1e-2
        )
    )
    test_case.assertTrue(
        np.allclose(
            flow_bias.grad.numpy(), torch_bias.grad.cpu().numpy(), rtol=1e-5, atol=1e-5
        )
    )