Fix char_embed for gpu

This commit is contained in:
Matthw Honnibal 2019-10-07 16:49:32 +02:00
parent f4040a98f0
commit a6a2ff217f

View File

@ -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