input: input: (n, c), idx : (m, nsample) output: (m, nsample, c)
(ctx, input, idx)
| 48 | class Grouping(Function): |
| 49 | @staticmethod |
| 50 | def forward(ctx, input, idx): |
| 51 | """ |
| 52 | input: input: (n, c), idx : (m, nsample) |
| 53 | output: (m, nsample, c) |
| 54 | """ |
| 55 | assert input.is_contiguous() and idx.is_contiguous() |
| 56 | m, nsample, n, c = idx.shape[0], idx.shape[1], input.shape[0], input.shape[1] |
| 57 | output = torch.cuda.FloatTensor(m, nsample, c) |
| 58 | pointops_cuda.grouping_forward_cuda(m, nsample, c, input, idx, output) |
| 59 | ctx.n = n |
| 60 | ctx.save_for_backward(idx) |
| 61 | return output |
| 62 | |
| 63 | @staticmethod |
| 64 | def backward(ctx, grad_output): |
nothing calls this directly
no outgoing calls
no test coverage detected