def with_cpu(ops, model):
model.to_cpu()<EOL>def with_cpu_forward(inputs, drop=<NUM_LIT:0.0>):<EOL><INDENT>cpu_outputs, backprop = model.begin_update(_to_cpu(inputs), drop=drop)<EOL>gpu_outputs = _to_device(ops, cpu_outputs)<EOL>def with_cpu_backprop(d_outputs, sgd=None):<EOL><INDENT>cpu_d_outputs = _to_cpu(d_outputs)<EOL>return backprop(cpu_d_outputs, sgd=sgd)<EOL><DEDENT>return gpu_outputs, with_cpu_backprop<EOL><DEDENT>return wrap(with_cpu_forward, model)<EOL>
Wrap a model that should run on CPU, transferring inputs and outputs
    as necessary.