def METHOD_NAME(self, dtype=torch.float, device='cuda'):
    if not torch.cuda.is_available() and device == 'cuda':
        pytest.skip('test requires GPU')
    if device == 'mlu':
        from mmcv.ops import \
            ModulatedDeformConv2dPack_MLU as ModulatedDeformConv2dPack
    else:
        from mmcv.ops import ModulatedDeformConv2dPack
    input = torch.tensor(input_t, dtype=dtype, device=device)
    input.requires_grad = True
    dcn = ModulatedDeformConv2dPack(
        1,
        1,
        kernel_size=(2, 2),
        stride=1,
        padding=1,
        deform_groups=1,
        bias=False).to(device)
    dcn.weight.data.fill_(1.)
    dcn.type(dtype)
    output = dcn(input)
    output.sum().backward()
    assert numpy.allclose(output.cpu().detach().numpy(), output_t, 1e-2)
    assert numpy.allclose(input.grad.cpu().detach().numpy(), input_grad,
                          1e-2)
    assert numpy.allclose(dcn.weight.grad.cpu().detach().numpy(),
                          dcn_w_grad, 1e-2)
    assert numpy.allclose(
        dcn.conv_offset.weight.grad.cpu().detach().numpy(),
        dcn_offset_w_grad, 1e-2)
    assert numpy.allclose(dcn.conv_offset.bias.grad.cpu().detach().numpy(),
                          dcn_offset_b_grad, 1e-2)