@@ -56,7 +56,6 @@ def test_ivf_kmeans(self):
56
56
Dref , Iref = ivfk .search (ev .xq , 100 )
57
57
ivfk .parallel_mode = 1
58
58
Dnew , Inew = ivfk .search (ev .xq , 100 )
59
- print ((Iref != Inew ).sum (), Iref .size )
60
59
assert (Iref != Inew ).sum () < Iref .size / 5000.0
61
60
assert np .all (Dref == Dnew )
62
61
@@ -136,8 +135,6 @@ def test_polysemous(self):
136
135
137
136
res = ev .launch ("Polysemous ht=%d" % index .polysemous_ht , index )
138
137
e_polysemous = ev .evalres (res )
139
- print (e_baseline , e_polysemous , index .polysemous_ht )
140
- print (stats .n_hamming_pass , stats .ncode )
141
138
# The randu dataset is difficult, so we are not too picky on
142
139
# the results. Here we assert that we have < 10 % loss when
143
140
# computing full PQ on fewer than 20% of the data.
@@ -248,7 +245,6 @@ def subtest(self, mt):
248
245
index .nprobe = 4 # hopefully more robust than 1
249
246
D , I = index .search (xq , 10 )
250
247
ninter = faiss .eval_intersection (I , gt_I )
251
- print ("(%d, %s): %d, " % (mt , repr (qname ), ninter ))
252
248
assert abs (ninter - self .ref_results [(mt , qname )]) <= 10
253
249
254
250
if qname == "6bit" :
@@ -264,7 +260,6 @@ def subtest(self, mt):
264
260
radius = float (D [:, - 1 ].max ())
265
261
else :
266
262
radius = float (D [:, - 1 ].min ())
267
- # print("radius", radius)
268
263
269
264
lims , D3 , I3 = index .range_search (xq , radius )
270
265
ntot = ndiff = 0
@@ -278,14 +273,11 @@ def subtest(self, mt):
278
273
Iref = set (I2 [i , mask ])
279
274
ndiff += len (Inew ^ Iref )
280
275
ntot += len (Iref )
281
- # print("ndiff %d / %d" % (ndiff, ntot))
282
276
assert ndiff < ntot * 0.01
283
277
284
278
for pm in 1 , 2 :
285
- # print("parallel_mode=%d" % pm)
286
279
index .parallel_mode = pm
287
280
lims4 , D4 , I4 = index .range_search (xq , radius )
288
- # print("sizes", lims4[1:] - lims4[:-1])
289
281
for qno in range (len (lims ) - 1 ):
290
282
Iref = I3 [lims [qno ]: lims [qno + 1 ]]
291
283
Inew = I4 [lims4 [qno ]: lims4 [qno + 1 ]]
@@ -485,7 +477,6 @@ def subtest(self, mt):
485
477
D , I = index .search (xq , 10 )
486
478
487
479
ninter = faiss .eval_intersection (I , gt_I )
488
- print ("(%d, %s): %d, " % (mt , by_residual , ninter ))
489
480
490
481
assert abs (ninter - self .ref_results [mt , by_residual ]) <= 3
491
482
@@ -499,10 +490,6 @@ def subtest(self, mt):
499
490
index .polysemous_ht = 20
500
491
D , I = index .search (xq , 10 )
501
492
ninter = faiss .eval_intersection (I , gt_I )
502
- print (
503
- "(%d, %s, %d): %d, "
504
- % (mt , by_residual , index .polysemous_ht , ninter )
505
- )
506
493
507
494
# polysemous behaves bizarrely on ARM
508
495
assert (
@@ -516,7 +503,6 @@ def subtest(self, mt):
516
503
radius = float (D [:, - 1 ].max ())
517
504
else :
518
505
radius = float (D [:, - 1 ].min ())
519
- print ("radius" , radius )
520
506
521
507
lims , D3 , I3 = index .range_search (xq , radius )
522
508
ntot = ndiff = 0
@@ -530,7 +516,6 @@ def subtest(self, mt):
530
516
Iref = set (I2 [i , mask ])
531
517
ndiff += len (Inew ^ Iref )
532
518
ntot += len (Iref )
533
- print ("ndiff %d / %d" % (ndiff , ntot ))
534
519
assert ndiff < ntot * 0.02
535
520
536
521
def test_IVFPQ_non8bit (self ):
@@ -555,7 +540,6 @@ def test_IVFPQ_non8bit(self):
555
540
556
541
D , I = index .search (xq , 10 )
557
542
ninter [v ] = faiss .eval_intersection (I , gt_I )
558
- print ("ninter=" , ninter )
559
543
# this should be the case but we don't observe
560
544
# that... Probavly too few test points
561
545
# assert ninter['2x8'] > ninter['8x2']
@@ -623,9 +607,6 @@ def test_OPQ(self):
623
607
res = ev .launch ("OPQ" , index )
624
608
e_opq = ev .evalres (res )
625
609
626
- print ("e_pq=%s" % e_pq )
627
- print ("e_opq=%s" % e_opq )
628
-
629
610
# verify that OPQ better than PQ
630
611
for r in 1 , 10 , 100 :
631
612
assert e_opq [r ] > e_pq [r ]
@@ -656,7 +637,6 @@ def test_OIVFPQ(self):
656
637
657
638
# verify same on OIVFPQ
658
639
for r in 1 , 10 , 100 :
659
- print (e_oivfpq [r ], e_ivfpq [r ])
660
640
assert e_oivfpq [r ] >= e_ivfpq [r ]
661
641
662
642
@@ -758,9 +738,6 @@ def test_sh(self):
758
738
ninter = faiss .eval_intersection (I , gt_I )
759
739
key = (nbit , tt , period )
760
740
761
- print ("(%d, %s, %g): %d, " % (nbit , repr (tt ), period ,
762
- ninter ))
763
- print (abs (ninter - self .ref_results [key ]))
764
741
assert abs (ninter - self .ref_results [key ]) <= 14
765
742
766
743
@@ -799,7 +776,6 @@ def do_test(self, metric):
799
776
# check that with refinement, the recall@10 is the same as
800
777
# the original recall@100
801
778
recall2 = (I2 == Iref [:, :1 ]).sum ()
802
- # print("recalls", recall1, recall2)
803
779
self .assertEqual (recall1 , recall2 )
804
780
805
781
def test_IP (self ):
0 commit comments