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)
read_InvertedLists (ivpq, f, io_flags);
}
// precomputed table not stored. It is cheaper to recompute it
ivpq->use_precomputed_table = 0;
if (ivpq->by_residual)
ivpq->precompute_table ();
if (ivfpqr) {
read_ProductQuantizer (&ivfpqr->refine_pq, f);
READVECTOR (ivfpqr->refine_codes);
READ1 (ivfpqr->k_factor);
if (ivpq->is_trained) {
// precomputed table not stored. It is cheaper to recompute it
ivpq->use_precomputed_table = 0;
if (ivpq->by_residual)
ivpq->precompute_table();
if (ivfpqr) {
read_ProductQuantizer(&ivfpqr->refine_pq, f);
READVECTOR (ivfpqr->refine_codes);
READ1 (ivfpqr->k_factor);
}
}
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