Skip to content

Commit

Permalink
Test that the AnnoyIndexer is disabled in most_similar when topn is None
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Apr 29, 2019
1 parent fbfe2d4 commit 2f16efe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gensim/test/test_similarities.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,12 @@ def assertApproxNeighborsMatchExact(self, model, wv, index):

self.assertEqual(approx_words, exact_words)

def assertAllSimilaritiesDisableIndexer(self, model, wv, index):
vector = wv.vectors_norm[0]
approx_neighbors = model.wv.most_similar([vector], topn=None, indexer=index)

self.assertEqual(len(predicted), len(wv.vectors.vocab))

def assertIndexSaved(self, index):
fname = get_tmpfile('gensim_similarities.tst.pkl')
index.save(fname)
Expand Down

0 comments on commit 2f16efe

Please sign in to comment.