From 6f3bb6f77cb3691281fde1f18a75038bb3a15890 Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Mon, 13 Jul 2020 23:05:33 +0200 Subject: [PATCH] fix doc.to_utf8 on GPU (#5757) --- spacy/ml/_character_embed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/ml/_character_embed.py b/spacy/ml/_character_embed.py index f4890144a..57fbf73b3 100644 --- a/spacy/ml/_character_embed.py +++ b/spacy/ml/_character_embed.py @@ -34,7 +34,7 @@ def forward(model, docs, is_train): # for the tip. nCv = model.ops.xp.arange(nC) for doc in docs: - doc_ids = doc.to_utf8_array(nr_char=nC) + doc_ids = model.ops.asarray(doc.to_utf8_array(nr_char=nC)) doc_vectors = model.ops.alloc3f(len(doc), nC, nM) # Let's say I have a 2d array of indices, and a 3d table of data. What numpy # incantation do I chant to get