Skip to content

Commit

Permalink
Ensures FastText returns consistent dtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcobzarenco committed Oct 19, 2017
1 parent e92b45d commit 31ef726
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gensim/models/wrappers/fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def word_vec(self, word, use_norm=False):
if word in self.vocab:
return super(FastTextKeyedVectors, self).word_vec(word, use_norm)
else:
word_vec = np.zeros(self.syn0_ngrams.shape[1])
word_vec = np.zeros(self.syn0_ngrams.shape[1], dtype=np.float32)
ngrams = compute_ngrams(word, self.min_n, self.max_n)
ngrams = [ng for ng in ngrams if ng in self.ngrams]
if use_norm:
Expand Down

0 comments on commit 31ef726

Please sign in to comment.