def backward(self, grad_output): input1, input2 = self.saved_variables kH, kW = self.kernel_size patchH, patchW = self.patch_size padH, padW = self.padding dilation_patchH, dilation_patchW = self.dilation_patch dH, dW = self.stride grad_input1, grad_input2 = correlation.backward( input1, input2, grad_output, kH, kW, patchH, patchW, padH, padW, dilation_patchH, dilation_patchW, dH, dW) return grad_input1, grad_input2
def backward(ctx, grad_output): input1, input2 = ctx.saved_variables kD, kH, kW = ctx.kernel_size patchD, patchH, patchW = ctx.patch_size padD, padH, padW = ctx.padding dilation_patchD, dilation_patchH, dilation_patchW = ctx.dilation_patch dD, dH, dW = ctx.stride grad_input1, grad_input2 = correlation.backward( input1, input2, grad_output, kD, kH, kW, patchD, patchH, patchW, padD, padH, padW, dilation_patchD, dilation_patchH, dilation_patchW, dD, dH, dW) return grad_input1, grad_input2, None, None, None, None, None