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