Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remove ids for indexrefine #4026

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
8 changes: 8 additions & 0 deletions faiss/IndexRefine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ void IndexRefine::add(idx_t n, const float* x) {
ntotal = refine_index->ntotal;
}

size_t IndexRefine::remove_ids(const IDSelector& sel) {
FAISS_THROW_IF_NOT(is_trained);
base_index->remove_ids(sel);
refine_index->remove_ids(sel);
ntotal = refine_index->ntotal;
return ntotal;
Tickdack marked this conversation as resolved.
Show resolved Hide resolved
}

void IndexRefine::reset() {
base_index->reset();
refine_index->reset();
Expand Down
2 changes: 2 additions & 0 deletions faiss/IndexRefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ struct IndexRefine : Index {

void add(idx_t n, const float* x) override;

size_t remove_ids(const IDSelector& sel) override;

void reset() override;

void search(
Expand Down
Loading