From d5537e55163ced314bf171e2b09c765c70121b9a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 8 Nov 2017 13:24:47 +0100 Subject: [PATCH] Work on Windows test failure --- spacy/_ml.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacy/_ml.py b/spacy/_ml.py index 246979a4f..9811ce36a 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -94,7 +94,10 @@ def _zero_init(model): def _preprocess_doc(docs, drop=0.): keys = [doc.to_array([LOWER]) for doc in docs] ops = Model.ops - lengths = ops.asarray([arr.shape[0] for arr in keys], dtype='int64') + # The dtype here matches what thinc is expecting -- which differs per + # platform (by int definition). This should be fixed once the problem + # is fixed on Thinc's side. + lengths = ops.asarray([arr.shape[0] for arr in keys], dtype=numpy.int_) keys = ops.xp.concatenate(keys) vals = ops.allocate(keys.shape[0]) + 1 return (keys, vals, lengths), None