Skip to content

Commit

Permalink
Fix is_trained in IndexHNSWSQ (facebookresearch#3034)
Browse files Browse the repository at this point in the history
Summary:
### Description
Even though `is_trained` is set as `true` in [IndexScalarQuantizer](https://github.com/facebookresearch/faiss/blob/main/faiss/IndexScalarQuantizer.cpp#L34). It is again overwritten as `false` in [IndexHNSW](https://github.com/facebookresearch/faiss/blob/main/faiss/IndexHNSW.cpp#L910) which is failing at this [validation check](https://github.com/facebookresearch/faiss/blob/main/faiss/IndexHNSW.cpp#L363) while ingesting vectors. Raising this PR with a small change to fix it.

Pull Request resolved: facebookresearch#3034

Reviewed By: pemazare

Differential Revision: D48900445

Pulled By: mdouze

fbshipit-source-id: 16b1cf17e9d8900c4a42956d466e30c76b13d064
  • Loading branch information
naveentatikonda authored and abhinavdangeti committed Jul 12, 2024
1 parent a2d7f42 commit 01c67f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion faiss/IndexHNSW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ IndexHNSWSQ::IndexHNSWSQ(
int M,
MetricType metric)
: IndexHNSW(new IndexScalarQuantizer(d, qtype, metric), M) {
is_trained = false;
is_trained = this->storage->is_trained;
own_fields = true;
}

Expand Down

0 comments on commit 01c67f4

Please sign in to comment.