未验证 提交 889c9190 编写于 作者: J Jeff Wang 提交者: GitHub

Use _prog_and_scope_guard to switch the scope (#10421)

上级 f43b71b2
......@@ -173,9 +173,9 @@ class Trainer(object):
def save_params(self, param_path):
# reference: save_persistables in io.py
exe = executor.Executor(self.place)
io.save_persistables(
exe, dirname=param_path, main_program=self.startup_program)
with self._prog_and_scope_guard():
exe = executor.Executor(self.place)
io.save_persistables(exe, dirname=param_path)
@staticmethod
def _check_and_get_place(place):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册