Work on Windows test failure

This commit is contained in:
Matthew Honnibal 2017-11-08 13:24:47 +01:00
parent c27c82d5f9
commit d5537e5516
1 changed files with 4 additions and 1 deletions

View File

@ -94,7 +94,10 @@ def _zero_init(model):
def _preprocess_doc(docs, drop=0.): def _preprocess_doc(docs, drop=0.):
keys = [doc.to_array([LOWER]) for doc in docs] keys = [doc.to_array([LOWER]) for doc in docs]
ops = Model.ops 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) keys = ops.xp.concatenate(keys)
vals = ops.allocate(keys.shape[0]) + 1 vals = ops.allocate(keys.shape[0]) + 1
return (keys, vals, lengths), None return (keys, vals, lengths), None