Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: min.tian <[email protected]>
  • Loading branch information
alwayslove2013 committed Dec 30, 2024
1 parent ca966b8 commit 7a5a27d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/knowhere/index/index_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,9 @@ class IndexIterator : public IndexNode::iterator {

// An iterator implementation that accepts a function to get distances and ids list and returns them in order.
// We do not directly accept a distance list as input. The main reason for this is to minimize the initialization time
// for all types of iterators in the `ANNIterator` interface, moving heavy computations to the first '->Next()' call. This
// way, the iterator initialization does not need to perform any concurrent acceleration, and the search pool only
// needs to handle the heavy work of `->Next()`
// for all types of iterators in the `ANNIterator` interface, moving heavy computations to the first '->Next()' call.
// This way, the iterator initialization does not need to perform any concurrent acceleration, and the search pool
// only needs to handle the heavy work of `->Next()`
template <typename Compute_Dist_Func, bool use_knowhere_search_pool = true>
class PrecomputedDistanceIterator : public IndexNode::iterator {
public:
Expand Down
3 changes: 2 additions & 1 deletion src/index/sparse/sparse_index_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ class SparseInvertedIndexNode : public IndexNode {
auto vec = std::vector<std::shared_ptr<IndexNode::iterator>>(nq, nullptr);
try {
for (int i = 0; i < nq; ++i) {
// Heavy computations with `compute_dist_func` will be deferred until the first call to 'Iterator->Next()'.
// Heavy computations with `compute_dist_func` will be deferred until the first call to
// 'Iterator->Next()'.
auto compute_dist_func = [=]() -> std::vector<float> {
auto queries = static_cast<const sparse::SparseRow<T>*>(dataset->GetTensor());
return index_->GetAllDistances(queries[i], drop_ratio_search, bitset, computer);
Expand Down

0 comments on commit 7a5a27d

Please sign in to comment.