We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03e61c4 commit f47eabbCopy full SHA for f47eabb
cpu/src/neighbors.cpp
@@ -119,8 +119,6 @@ int nanoflann_neighbors(vector<scalar_t>& queries,
119
}
120
i0++;
121
122
-
123
124
125
return max_count;
126
test/test_ballquerry.py
@@ -30,10 +30,17 @@ def test_larger_gpu(self):
30
31
@run_if_cuda
32
def test_cpu_gpu_equality(self):
33
- a = torch.randn(2, 10, 3)
34
- b = torch.randn(2, 5, 3)
35
- res_cpu = ball_query(1, 17, a, b).detach().numpy()
36
- res_cuda = ball_query(1, 17, a.cuda(), b.cuda()).cpu().detach().numpy()
+ a = torch.randn(5, 1000, 3)
+ b = torch.randn(5, 500, 3)
+ res_cpu = ball_query(1, 500, a, b).detach().numpy()
+ res_cuda = ball_query(1, 500, a.cuda(), b.cuda()).cpu().detach().numpy()
37
+ for i in range(b.shape[0]):
38
+ for j in range(b.shape[1]):
39
+ # Because it is not necessary the same order
40
+ assert set(res_cpu[i][j]) == set(res_cuda[i][j])
41
+
42
+ res_cpu = ball_query(0.01, 500, a, b).detach().numpy()
43
+ res_cuda = ball_query(0.01, 500, a.cuda(), b.cuda()).cpu().detach().numpy()
44
for i in range(b.shape[0]):
45
for j in range(b.shape[1]):
46
# Because it is not necessary the same order
0 commit comments