input: input1: (n, c), input2: (n, c), idx: (n, nsample) output: (n, nsample, c)
(ctx, input1, input2, idx)
| 103 | class Subtraction(Function): |
| 104 | @staticmethod |
| 105 | def forward(ctx, input1, input2, idx): |
| 106 | """ |
| 107 | input: input1: (n, c), input2: (n, c), idx: (n, nsample) |
| 108 | output: (n, nsample, c) |
| 109 | """ |
| 110 | assert input1.is_contiguous() and input2.is_contiguous() |
| 111 | n, c = input1.shape; nsample = idx.shape[-1] |
| 112 | output = torch.cuda.FloatTensor(n, nsample, c).zero_() |
| 113 | pointops_cuda.subtraction_forward_cuda(n, nsample, c, input1, input2, idx, output) |
| 114 | ctx.save_for_backward(idx) |
| 115 | return output |
| 116 | |
| 117 | @staticmethod |
| 118 | def backward(ctx, grad_output): |
nothing calls this directly
no outgoing calls
no test coverage detected