Add comment

This commit is contained in:
Matthew Honnibal 2019-03-09 17:51:17 +00:00
parent 28c26e212d
commit ce1fe8a510

View File

@ -94,6 +94,8 @@ def _preprocess_doc(docs, drop=0.0):
def with_cpu(ops, model): def with_cpu(ops, model):
"""Wrap a model that should run on CPU, transferring inputs and outputs
as necessary."""
model.to_cpu() model.to_cpu()
def with_cpu_forward(inputs, drop=0.): def with_cpu_forward(inputs, drop=0.):
cpu_outputs, backprop = model.begin_update(_to_cpu(inputs), drop=drop) cpu_outputs, backprop = model.begin_update(_to_cpu(inputs), drop=drop)