Commit 5d1ed5b6 authored by Pierre Letessier's avatar Pierre Letessier Committed by Lucas Hosseini

Fix unable to read untrained index (#817)

parent 012954eb
...@@ -866,14 +866,16 @@ static IndexIVFPQ *read_ivfpq (IOReader *f, uint32_t h, int io_flags) ...@@ -866,14 +866,16 @@ static IndexIVFPQ *read_ivfpq (IOReader *f, uint32_t h, int io_flags)
read_InvertedLists (ivpq, f, io_flags); read_InvertedLists (ivpq, f, io_flags);
} }
// precomputed table not stored. It is cheaper to recompute it if (ivpq->is_trained) {
ivpq->use_precomputed_table = 0; // precomputed table not stored. It is cheaper to recompute it
if (ivpq->by_residual) ivpq->use_precomputed_table = 0;
ivpq->precompute_table (); if (ivpq->by_residual)
if (ivfpqr) { ivpq->precompute_table();
read_ProductQuantizer (&ivfpqr->refine_pq, f); if (ivfpqr) {
READVECTOR (ivfpqr->refine_codes); read_ProductQuantizer(&ivfpqr->refine_pq, f);
READ1 (ivfpqr->k_factor); READVECTOR (ivfpqr->refine_codes);
READ1 (ivfpqr->k_factor);
}
} }
return ivpq; return ivpq;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment