From b3312677bff00f95786c52f8cd4d67891b33f37b Mon Sep 17 00:00:00 2001 From: "min.tian" Date: Fri, 27 Dec 2024 16:43:54 +0800 Subject: [PATCH] fix Signed-off-by: min.tian --- src/common/comp/brute_force.cc | 4 ++-- src/index/sparse/sparse_index_node.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/comp/brute_force.cc b/src/common/comp/brute_force.cc index a4c6083f7..87a3a546c 100644 --- a/src/common/comp/brute_force.cc +++ b/src/common/comp/brute_force.cc @@ -787,7 +787,7 @@ BruteForce::AnnIterator(const DataSetPtr base_dataset, const DataSetPtr query_da try { for (int i = 0; i < nq; ++i) { - auto compute_dist_func = [&, index = i, base_dataset, query_dataset]() -> std::vector { + auto compute_dist_func = [=, index = i]() -> std::vector { auto xb = base_dataset->GetTensor(); auto xq = query_dataset->GetTensor(); auto xb_id_offset = base_dataset->GetTensorBeginId(); @@ -925,7 +925,7 @@ BruteForce::AnnIterator>(const DataSetPtr bas auto vec = std::vector(nq, nullptr); try { for (int64_t i = 0; i < nq; ++i) { - auto compute_dist_func = [&, index = i, base_dataset, query_dataset]() -> std::vector { + auto compute_dist_func = [=, index = i]() -> std::vector { auto xq = static_cast*>(query_dataset->GetTensor()); auto base = static_cast*>(base_dataset->GetTensor()); const auto& row = xq[index]; diff --git a/src/index/sparse/sparse_index_node.cc b/src/index/sparse/sparse_index_node.cc index a8d551853..1ffb3876d 100644 --- a/src/index/sparse/sparse_index_node.cc +++ b/src/index/sparse/sparse_index_node.cc @@ -190,7 +190,7 @@ class SparseInvertedIndexNode : public IndexNode { auto vec = std::vector>(nq, nullptr); try { for (int i = 0; i < nq; ++i) { - auto compute_dist_func = [&, index = i, dataset, computer]() -> std::vector { + auto compute_dist_func = [=, index = i]() -> std::vector { auto queries = static_cast*>(dataset->GetTensor()); return index_->GetAllDistances(queries[index], drop_ratio_search, bitset, computer); };