mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Add comment
This commit is contained in:
parent
28c26e212d
commit
ce1fe8a510
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user