From 20bc9fdb289b14d0429a42c71cd9ac38a841b870 Mon Sep 17 00:00:00 2001 From: "min.tian" Date: Fri, 2 Feb 2024 10:55:56 +0800 Subject: [PATCH] add comments for ivfflat getIteratorNext() Signed-off-by: min.tian --- thirdparty/faiss/faiss/IndexIVFFlat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/thirdparty/faiss/faiss/IndexIVFFlat.h b/thirdparty/faiss/faiss/IndexIVFFlat.h index b5417fe53..136bcf5a3 100644 --- a/thirdparty/faiss/faiss/IndexIVFFlat.h +++ b/thirdparty/faiss/faiss/IndexIVFFlat.h @@ -53,7 +53,7 @@ struct IndexIVFFlat : IndexIVF { void restore_codes(const uint8_t* raw_data, const size_t raw_size); // Be careful with overriding this function, because - // renormalized x may be used inside. + // renormalized x may be used inside. // Overridden by IndexIVFFlatDedup. void train(idx_t n, const float* x) override; @@ -88,6 +88,12 @@ struct IndexIVFFlat : IndexIVF { const float* query_data, const IVFSearchParameters* ivfsearchParams) const; + // Unlike regular knn-search, the iterator does not know the size `k` of the + // returned result. + // The workspace will maintain a heap of at least (nprobe/nlist) nodes for + // iterator `Next()` operation. + // When there are not enough nodes in the heap, iterator will scan the + // next coarse list. std::optional> getIteratorNext( IVFFlatIteratorWorkspace* workspace) const; };