From d396a69c7bca2b39ed44fda68042c9b18db188f0 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 21 Feb 2019 17:12:23 +0100 Subject: [PATCH] More fixes for issue #3112 --- spacy/syntax/_parser_model.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/syntax/_parser_model.pyx b/spacy/syntax/_parser_model.pyx index 5bfb0b410..2660bb86a 100644 --- a/spacy/syntax/_parser_model.pyx +++ b/spacy/syntax/_parser_model.pyx @@ -204,7 +204,9 @@ class ParserModel(Model): if new_output == self.upper.nO: return smaller = self.upper - larger = Affine(new_output, smaller.nI) + + with Model.use_device('cpu'): + larger = Affine(new_output, smaller.nI) # Set nan as value for unseen classes, to prevent prediction. larger.W.fill(self.ops.xp.nan) larger.b.fill(self.ops.xp.nan)