Skip to content

Commit 5386cab

Browse files
committed
Update NND for return_distance=1
1 parent 2255584 commit 5386cab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cpp/src/neighbors/detail/nn_descent.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ void build(raft::resources const& res,
17461746
raft::make_host_matrix<int, int64_t, raft::row_major>(dataset.extent(0), extended_graph_degree);
17471747
17481748
// When the graph will be a complete graph, output it without NND process for better performance.
1749-
if (static_cast<size_t>(dataset.extent(0) - 1) == graph_degree) {
1749+
if (static_cast<size_t>(dataset.extent(0) - 1) == graph_degree && (!params.return_distances)) {
17501750
auto graph = idx.graph().data_handle();
17511751
#pragma omp parallel for
17521752
for (size_t i = 0; i < static_cast<size_t>(dataset.extent(0)); i++) {

0 commit comments

Comments
 (0)