mirror of
https://github.com/facebookresearch/faiss.git
synced 2026-10-12 02:13:36 +00:00
fix centroids_norms storage for ResidualCoarseQuantizer (#2018)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2018 The centroids norms table was not reconstructed correctly after being stored in RCQ. Reviewed By: Sugoshnr Differential Revision: D30484389 fbshipit-source-id: 9f618a3939c99dc987590c07eda8e76e19248b08
This commit is contained in:
committed by
Facebook GitHub Bot
parent
760cce7f3a
commit
151e3d7be5
@@ -497,6 +497,13 @@ class TestIVFResidualCoarseQuantizer(unittest.TestCase):
|
||||
np.testing.assert_array_almost_equal(Dref, Dnew, decimal=5)
|
||||
np.testing.assert_array_equal(Iref, Inew)
|
||||
|
||||
# check i/o
|
||||
CDref, CIref = quantizer.search(ds.get_queries(), 10)
|
||||
quantizer2 = faiss.deserialize_index(faiss.serialize_index(quantizer))
|
||||
quantizer2.search(ds.get_queries(), 10)
|
||||
CDnew, CInew = quantizer2.search(ds.get_queries(), 10)
|
||||
np.testing.assert_array_almost_equal(CDref, CDnew, decimal=5)
|
||||
np.testing.assert_array_equal(CIref, CInew)
|
||||
|
||||
###########################################################
|
||||
# Test search with LUTs
|
||||
|
||||
Reference in New Issue
Block a user