@@ -22,15 +22,14 @@ class TestSelector(unittest.TestCase):
22
22
combinations as possible.
23
23
"""
24
24
25
- def do_test_id_selector (self , index_key , id_selector_type = "batch" , mt = faiss .METRIC_L2 ):
25
+ def do_test_id_selector (self , index_key , id_selector_type = "batch" , mt = faiss .METRIC_L2 , k = 10 ):
26
26
""" Verify that the id selector returns the subset of results that are
27
27
members according to the IDSelector.
28
28
Supports id_selector_type="batch", "bitmap", "range", "range_sorted", "and", "or", "xor"
29
29
"""
30
30
ds = datasets .SyntheticDataset (32 , 1000 , 100 , 20 )
31
31
index = faiss .index_factory (ds .d , index_key , mt )
32
32
index .train (ds .get_train ())
33
- k = 10
34
33
35
34
# reference result
36
35
if "range" in id_selector_type :
@@ -145,6 +144,16 @@ def test_IVFFlat_range_sorted(self):
145
144
def test_IVFPQ (self ):
146
145
self .do_test_id_selector ("IVF32,PQ4x4np" )
147
146
147
+ def test_IVFPQfs (self ):
148
+ self .do_test_id_selector ("IVF32,PQ4x4fs" )
149
+
150
+ def test_IVFPQfs_k1 (self ):
151
+ self .do_test_id_selector ("IVF32,PQ4x4fs" , k = 1 )
152
+
153
+ def test_IVFPQfs_k40 (self ):
154
+ # test reservoir codepath
155
+ self .do_test_id_selector ("IVF32,PQ4x4fs" , k = 40 )
156
+
148
157
def test_IVFSQ (self ):
149
158
self .do_test_id_selector ("IVF32,SQ8" )
150
159
0 commit comments