Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: min.tian <[email protected]>
  • Loading branch information
alwayslove2013 committed Dec 27, 2024
1 parent 9cb0dba commit b331267
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/common/comp/brute_force.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<DistId> {
auto compute_dist_func = [=, index = i]() -> std::vector<DistId> {
auto xb = base_dataset->GetTensor();
auto xq = query_dataset->GetTensor();
auto xb_id_offset = base_dataset->GetTensorBeginId();
Expand Down Expand Up @@ -925,7 +925,7 @@ BruteForce::AnnIterator<knowhere::sparse::SparseRow<float>>(const DataSetPtr bas
auto vec = std::vector<IndexNode::IteratorPtr>(nq, nullptr);
try {
for (int64_t i = 0; i < nq; ++i) {
auto compute_dist_func = [&, index = i, base_dataset, query_dataset]() -> std::vector<DistId> {
auto compute_dist_func = [=, index = i]() -> std::vector<DistId> {
auto xq = static_cast<const sparse::SparseRow<float>*>(query_dataset->GetTensor());
auto base = static_cast<const sparse::SparseRow<float>*>(base_dataset->GetTensor());
const auto& row = xq[index];
Expand Down
2 changes: 1 addition & 1 deletion src/index/sparse/sparse_index_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class SparseInvertedIndexNode : public IndexNode {
auto vec = std::vector<std::shared_ptr<IndexNode::iterator>>(nq, nullptr);
try {
for (int i = 0; i < nq; ++i) {
auto compute_dist_func = [&, index = i, dataset, computer]() -> std::vector<float> {
auto compute_dist_func = [=, index = i]() -> std::vector<float> {
auto queries = static_cast<const sparse::SparseRow<T>*>(dataset->GetTensor());
return index_->GetAllDistances(queries[index], drop_ratio_search, bitset, computer);
};
Expand Down

0 comments on commit b331267

Please sign in to comment.