def METHOD_NAME(ctx, grad_output):
    input1, input2 = ctx.saved_tensors
    kH, kW = ctx.kernel_size
    patch_size = ctx.patch_size
    padH, padW = ctx.padding
    dilationH, dilationW = ctx.dilation
    dilation_patchH, dilation_patchW = ctx.dilation_patch
    dH, dW = ctx.stride
    grad_input1 = torch.zeros_like(input1)
    grad_input2 = torch.zeros_like(input2)
    ext_module.correlation_backward(
        grad_output,
        input1,
        input2,
        grad_input1,
        grad_input2,
        kH=kH,
        kW=kW,
        patchH=patch_size,
        patchW=patch_size,
        padH=padH,
        padW=padW,
        dilationH=dilationH,
        dilationW=dilationW,
        dilation_patchH=dilation_patchH,
        dilation_patchW=dilation_patchW,
        dH=dH,
        dW=dW)
    return grad_input1, grad_input2, None, None, None, None, None, None