Skip to content

Commit 06acee8

Browse files
Fixing typos in tests
1 parent 7138bb8 commit 06acee8

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ import torch
1717
import torch_points.points_cuda
1818
```
1919

20+
## Build and test
21+
```
22+
python setup.py build_ext --inplace
23+
python -m unittest
24+
```
25+
2026
## Projects using those kernels.
2127

2228
[```Pytorch Point Cloud Benchmark```](https://github.com/nicolas-chaulet/deeppointcloud-benchmarks) by

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
setup(
3737
name="torch_points",
38-
version="0.1.2",
38+
version="0.1.3",
3939
author="Nicolas Chaulet",
4040
packages=find_packages(),
4141
install_requires=[],

test/test_ballquerry.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ def test_simple_cpu(self):
2020
def test_cpu_gpu_equality(self):
2121
a = torch.randn(5, 1000, 3)
2222
npt.assert_array_equal(ball_query(0.1, 17, a, a).detach().numpy(),
23-
ball_query(0.1, 17, a.cuda(), a.cuda()).detach().numpy())
24-
25-
23+
ball_query(0.1, 17, a.cuda(), a.cuda()).cpu().detach().numpy())
2624

2725

2826
if __name__ == "__main__":

test/test_grouping.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import numpy.testing as npt
55
from torch_points import grouping_operation
66

7+
78
class TestGroup(unittest.TestCase):
89

910
# input: points(b, c, n) idx(b, npoints, nsample)
@@ -12,29 +13,29 @@ def test_simple(self):
1213
features = torch.tensor([
1314
[[0, 10, 0], [1, 11, 0], [2, 12, 0]],
1415
[
15-
[100, 110, 120], # x-coordinates
16-
[101, 111, 121], # y-coordinates
17-
[102, 112, 122], # z-coordinates
16+
[100, 110, 120], # x-coordinates
17+
[101, 111, 121], # y-coordinates
18+
[102, 112, 122], # z-coordinates
1819
]
19-
])
20+
]).type(torch.float)
2021
idx = torch.tensor([
2122
[[1, 0], [0, 0]],
2223
[[0, 1], [1, 2]]
23-
])
24+
]).type(torch.int)
2425

2526
expected = np.array([
2627
[
27-
[[10, 0], [0, 0]],
28-
[[11, 1], [1, 1]],
28+
[[10, 0], [0, 0]],
29+
[[11, 1], [1, 1]],
2930
[[12, 2], [2, 2]]
3031
],
31-
[ # 2nd batch
32-
[ # x-coordinates
33-
[100, 110], #x-coordinates of samples for point 0
34-
[110, 120], #x-coordinates of samples for point 1
35-
],
36-
[[101, 111], [111, 121]], # y-coordinates
37-
[[102, 112], [112, 122]], # z-coordinates
32+
[ # 2nd batch
33+
[ # x-coordinates
34+
[100, 110], # x-coordinates of samples for point 0
35+
[110, 120], # x-coordinates of samples for point 1
36+
],
37+
[[101, 111], [111, 121]], # y-coordinates
38+
[[102, 112], [112, 122]], # z-coordinates
3839
]
3940
])
4041

@@ -45,10 +46,10 @@ def test_simple(self):
4546
if torch.cuda.is_available():
4647
npt.assert_array_equal(
4748
grouping_operation(
48-
features.cuda(),
49+
features.cuda(),
4950
idx.cuda()
50-
).detach().cpu().numpy(), expected)
51+
).detach().cpu().numpy(), expected)
5152

5253

5354
if __name__ == '__main__':
54-
unittest.main()
55+
unittest.main()

torch_points/torchpoints.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ def gather_operation(features, idx):
7676
(B, C, N) tensor
7777
7878
idx : torch.Tensor
79-
(B, npoint, nsample) tensor of the features to gather
79+
(B, npoint) tensor of the features to gather
8080
8181
Returns
8282
-------
8383
torch.Tensor
84-
(B, C, npoint, nsample) tensor
84+
(B, C, npoint) tensor
8585
"""
8686
return GatherOperation.apply(features, idx)
8787

0 commit comments

Comments
 (0)