From f77bf2bdb1b62b97e9582fcc14d4550448a6340d Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 26 Mar 2019 13:36:11 +0100 Subject: [PATCH] Fix GPU training for textcat. Closes #3473 --- spacy/_ml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/_ml.py b/spacy/_ml.py index 2de876ec9..edcaf7c1f 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -614,9 +614,9 @@ def build_bow_text_classifier(nr_class, ngram_size=1, exclusive_classes=False, no_output_layer=False, **cfg): with Model.define_operators({">>": chain}): model = ( - extract_ngrams(ngram_size, attr=ORTH) - >> with_cpu(Model.ops, - LinearModel(nr_class) + with_cpu(Model.ops, + extract_ngrams(ngram_size, attr=ORTH) + >> LinearModel(nr_class) ) ) if not no_output_layer: