Skip to content

Commit 5295299

Browse files
Removed prints
1 parent d23709b commit 5295299

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
Pytorch kernels for pointnet++ like architectures
33

44
## Installation
5-
Requires torch version 1.0 or higher.
5+
Requires torch version 1.0 or higher. To install a specific version replace the version number with a given tag.
66
```
7-
pip install git+https://github.com/nicolas-chaulet/torch-points.git
7+
pip install git+https://github.com/nicolas-chaulet/torch-points.git#v0.2.3
88
```
99
or with poetry:
1010
```
11-
poetry add git+https://github.com/nicolas-chaulet/torch-points.git
11+
poetry add git+https://github.com/nicolas-chaulet/torch-points.git#v0.2.3
1212
```
1313

1414
## Usage

cpu/src/torch_nearest_neighbors.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,6 @@ std::pair<at::Tensor, at::Tensor> batch_ball_query(at::Tensor support, at::Tenso
8282
std::vector<long> support_batch_stl(support_batch.DATA_PTR<long>(),
8383
support_batch.DATA_PTR<long>() + support_batch.numel());
8484

85-
std::cout << std::endl;
86-
for (auto i : query_batch_stl)
87-
std::cout << i << " ";
88-
std::cout << std::endl;
89-
90-
for (auto i : support_batch_stl)
91-
std::cout << i << " ";
92-
std::cout << std::endl;
93-
9485
AT_DISPATCH_ALL_TYPES(query.scalar_type(), "batch_radius_search", [&] {
9586
std::vector<scalar_t> queries_stl(query.DATA_PTR<scalar_t>(),
9687
query.DATA_PTR<scalar_t>() + query.numel());
@@ -104,9 +95,6 @@ std::pair<at::Tensor, at::Tensor> batch_ball_query(at::Tensor support, at::Tenso
10495
auto neighbors_dists_ptr = neighbors_dists.data();
10596
long* neighbors_indices_ptr = neighbors_indices.data();
10697

107-
for (auto i : neighbors_indices)
108-
std::cout << i << " ";
109-
std::cout << std::endl;
11098
if (mode == 0)
11199
{
112100
idx =

test/test_ballquerry.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,23 @@ def test_simple_cpu(self):
8888
npt.assert_array_almost_equal(dist2, dist2_answer)
8989

9090
def test_random_cpu(self):
91-
a = torch.randn(10, 3).to(torch.float)
92-
b = torch.randn(10, 3).to(torch.float)
91+
a = torch.randn(100, 3).to(torch.float)
92+
b = torch.randn(50, 3).to(torch.float)
9393
batch_a = torch.tensor([0 for i in range(a.shape[0] // 2)] + [1 for i in range(a.shape[0] // 2, a.shape[0])])
9494
batch_b = torch.tensor([0 for i in range(b.shape[0] // 2)] + [1 for i in range(b.shape[0] // 2, b.shape[0])])
9595
R = 1
9696

97-
idx, dist = ball_query(R, 5, a, b, mode="PARTIAL_DENSE", batch_x=batch_a, batch_y=batch_b)
97+
idx, dist = ball_query(R, 15, a, b, mode="PARTIAL_DENSE", batch_x=batch_a, batch_y=batch_b)
9898
self.assertEqual(idx.shape[0], b.shape[0])
9999
self.assertEqual(dist.shape[0], b.shape[0])
100-
self.assertLessEqual(idx.max().item(), len(batch_b))
100+
self.assertLessEqual(idx.max().item(), len(batch_a))
101101

102102
# Comparison to see if we have the same result
103103
tree = KDTree(a.detach().numpy())
104104
idx3_sk = tree.query_radius(b.detach().numpy(), r=R)
105105
i = np.random.randint(len(batch_b))
106106
for p in idx[i].detach().numpy():
107-
if p < len(batch_b):
107+
if p < len(batch_a):
108108
assert p in idx3_sk[i]
109109

110110

0 commit comments

Comments
 (0)