Copy vectors to GPU on begin training

This commit is contained in:
Matthew Honnibal 2017-09-18 18:04:16 -05:00
parent 3fa76c17d1
commit c858927271

View File

@ -364,6 +364,9 @@ class Language(object):
device.use() device.use()
Model.ops = CupyOps() Model.ops = CupyOps()
Model.Ops = CupyOps Model.Ops = CupyOps
if self.vocab.vectors.data.shape[1] >= 1:
self.vocab.vectors.data = Model.ops.asarray(
self.vocab.vectors.data)
else: else:
device = None device = None
for proc in self.pipeline: for proc in self.pipeline: