| 8 | |
| 9 | |
| 10 | class FurthestSampling(Function): |
| 11 | @staticmethod |
| 12 | def forward(ctx, xyz, offset, new_offset): |
| 13 | """ |
| 14 | input: xyz: (n, 3), offset: (b), new_offset: (b) |
| 15 | output: idx: (m) |
| 16 | """ |
| 17 | assert xyz.is_contiguous() |
| 18 | n, b, n_max = xyz.shape[0], offset.shape[0], offset[0] |
| 19 | for i in range(1, b): |
| 20 | n_max = max(offset[i] - offset[i-1], n_max) |
| 21 | idx = torch.cuda.IntTensor(new_offset[b-1].item()).zero_() |
| 22 | tmp = torch.cuda.FloatTensor(n).fill_(1e10) |
| 23 | pointops_cuda.furthestsampling_cuda(b, n_max, xyz, offset, new_offset, tmp, idx) |
| 24 | del tmp |
| 25 | return idx |
| 26 | |
| 27 | furthestsampling = FurthestSampling.apply |
| 28 |
nothing calls this directly
no outgoing calls
no test coverage detected