未验证 提交 4d6a3b9f 编写于 作者: F From00 提交者: GitHub

Fix bug for UT test_calc_gradient (#41130)

上级 4b61918d
......@@ -122,6 +122,7 @@ class TestDoubleGradient(unittest.TestCase):
return start_prog, main_prog, [grad_x, jvp]
def test_calc_gradient(self):
with paddle.fluid.scope_guard(paddle.static.Scope()):
start_prog, main_prog, fetch_list = self.build_program()
exe = paddle.static.Executor()
exe.run(start_prog)
......@@ -158,6 +159,7 @@ class TestDoubleGradient2(unittest.TestCase):
return start_prog, main_prog, [grad_x, jvp]
def test_calc_gradient(self):
with paddle.fluid.scope_guard(paddle.static.Scope()):
start_prog, main_prog, fetch_list = self.build_program()
exe = paddle.static.Executor()
exe.run(start_prog)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册