From a6a2ff217f71d47cd92d9482bda029ab1250d575 Mon Sep 17 00:00:00 2001 From: Matthw Honnibal Date: Mon, 7 Oct 2019 16:49:32 +0200 Subject: [PATCH] Fix char_embed for gpu --- spacy/_ml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/_ml.py b/spacy/_ml.py index 86dac6c7a..25cd1b65f 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -932,7 +932,7 @@ class CharacterEmbed(Model): # for the tip. nCv = self.ops.xp.arange(self.nC) for doc in docs: - doc_ids = doc.to_utf8_array(nr_char=self.nC) + doc_ids = self.ops.asarray(doc.to_utf8_array(nr_char=self.nC)) doc_vectors = self.ops.allocate((len(doc), self.nC, self.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