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

Class FurthestSampling

pointops2/functions/pointops2.py:10–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class 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
27furthestsampling = FurthestSampling.apply
28

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected