Skip to content

Commit

Permalink
Fix bug in Similarity.query_shards in multiprocessing case (#2044)
Browse files Browse the repository at this point in the history
  • Loading branch information
bohea authored and menshikh-iv committed Jun 22, 2018
1 parent cc441b7 commit fd6f6eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gensim/similarities/docsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def query_shards(self, query):
if PARALLEL_SHARDS and PARALLEL_SHARDS > 1:
logger.debug("spawning %i query processes", PARALLEL_SHARDS)
pool = multiprocessing.Pool(PARALLEL_SHARDS)
result = pool.imap(query_shard, args, chunksize=1 + len(args) / PARALLEL_SHARDS)
result = pool.imap(query_shard, args, chunksize=1 + len(list(args)) / PARALLEL_SHARDS)
else:
# serial processing, one shard after another
pool = None
Expand Down

0 comments on commit fd6f6eb

Please sign in to comment.