MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / backward

Method backward

pointops2/functions/pointops.py:710–720  ·  view source on GitHub ↗

input: grad_out: (n, nsample, c) output: grad_input1: (n, c), grad_input2: (n, c)

(ctx, grad_output)

Source from the content-addressed store, hash-verified

708
709 @staticmethod
710 def backward(ctx, grad_output):
711 """
712 input: grad_out: (n, nsample, c)
713 output: grad_input1: (n, c), grad_input2: (n, c)
714 """
715 idx, = ctx.saved_tensors
716 n, nsample, c = grad_output.shape
717 grad_input1 = torch.cuda.FloatTensor(n, c).zero_()
718 grad_input2 = torch.cuda.FloatTensor(n, c).zero_()
719 pointops_cuda.subtraction_backward_cuda(n, nsample, c, idx, grad_output, grad_input1, grad_input2)
720 return grad_input1, grad_input2, None
721
722subtraction = Subtraction.apply
723

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected