Skip to content

Commit

Permalink
fixed a bug in which max_num_neighbors was not handled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Aug 5, 2020
1 parent 99d0792 commit 0841c7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion csrc/cpu/radius_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ torch::Tensor radius_cpu(torch::Tensor x, torch::Tensor y,
size_t num_matches = mat_index.index->radiusSearch(
y_data + i * y.size(1), r * r + 0.00001, ret_matches, params);

for (size_t j = 0; j < num_matches; j++) {
for (size_t j = 0;
j < std::min(num_matches, (size_t)max_num_neighbors); j++) {
out_vec.push_back(x_start + ret_matches[j].first);
out_vec.push_back(i);
}
Expand Down

0 comments on commit 0841c7c

Please sign in to comment.