From ce1fe8a5104fd48a9b27a3d5102aa686c82773d0 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 9 Mar 2019 17:51:17 +0000 Subject: [PATCH] Add comment --- spacy/_ml.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/_ml.py b/spacy/_ml.py index e2a5acf13..168519bfe 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -94,6 +94,8 @@ def _preprocess_doc(docs, drop=0.0): def with_cpu(ops, model): + """Wrap a model that should run on CPU, transferring inputs and outputs + as necessary.""" model.to_cpu() def with_cpu_forward(inputs, drop=0.): cpu_outputs, backprop = model.begin_update(_to_cpu(inputs), drop=drop)