提交 2c5fee53 编写于 作者: F flame 提交者: Yibing Liu

save infer model bug fix (#16224)

* save infer model bug fix

* test=release/1.3
上级 11997c8e
......@@ -948,10 +948,11 @@ def save_inference_model(dirname,
# TODO(Superjomn) add an IR pass to remove 1-scale op.
with program_guard(main_program):
uniq_target_vars = []
for var in target_vars:
for i, var in enumerate(target_vars):
if isinstance(var, Variable):
var1 = layers.scale(var, 1.)
uniq_target_vars.append(var1)
var = layers.scale(
var, 1., name="save_infer_model/scale_{}".format(i))
uniq_target_vars.append(var)
target_vars = uniq_target_vars
# when a pserver and a trainer running on the same machine, mkdir may conflict
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册