提交 311c92a4 编写于 作者: W wanghaoshuang

Add syntax 'with average_model.apply(exe)'

上级 f9653a6a
......@@ -81,8 +81,7 @@ def train(args, data_reader=dummy_reader):
sys.stdout.flush()
batch_id += 1
if model_average != None:
model_average.apply(exe)
with model_average.apply(exe):
error_evaluator.reset(exe)
for data in test_reader():
exe.run(inference_program, feed=get_feeder_data(data, place))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册