Commit 0841c7c3 authored by rusty1s's avatar rusty1s
Browse files

fixed a bug in which max_num_neighbors was not handled correctly

parent 99d0792e
...@@ -88,7 +88,8 @@ torch::Tensor radius_cpu(torch::Tensor x, torch::Tensor y, ...@@ -88,7 +88,8 @@ torch::Tensor radius_cpu(torch::Tensor x, torch::Tensor y,
size_t num_matches = mat_index.index->radiusSearch( size_t num_matches = mat_index.index->radiusSearch(
y_data + i * y.size(1), r * r + 0.00001, ret_matches, params); 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(x_start + ret_matches[j].first);
out_vec.push_back(i); out_vec.push_back(i);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment