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 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions faiss/IndexRefine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ 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);
size_t nremove = refine_index->remove_ids(sel);
return nremove;
}

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