fix doc.to_utf8 on GPU (#5757)

This commit is contained in:
Sofie Van Landeghem 2020-07-13 23:05:33 +02:00 committed by GitHub
parent dcfa910e4e
commit 6f3bb6f77c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ def forward(model, docs, is_train):
# for the tip. # for the tip.
nCv = model.ops.xp.arange(nC) nCv = model.ops.xp.arange(nC)
for doc in docs: 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) 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 # Let's say I have a 2d array of indices, and a 3d table of data. What numpy
# incantation do I chant to get # incantation do I chant to get