From 713d5a4bb032019c8ead982a4a1a573c286a1f27 Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Tue, 3 May 2022 21:46:24 +0800 Subject: [PATCH] Hotfix Release 2.3 Bug for CUDA 11.2 (#42438) * Fix Release 2.3 Bug * Fix format --- python/paddle/fluid/tests/unittests/test_cond.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_cond.py b/python/paddle/fluid/tests/unittests/test_cond.py index 0470a2df35..d9cb0ccf48 100644 --- a/python/paddle/fluid/tests/unittests/test_cond.py +++ b/python/paddle/fluid/tests/unittests/test_cond.py @@ -235,12 +235,13 @@ class TestCondInputOutput(unittest.TestCase): place = fluid.CUDAPlace(0) if core.is_compiled_with_cuda( ) else fluid.CPUPlace() exe = fluid.Executor(place) - ret = exe.run(main_program, fetch_list=[out, a.grad_name, b.grad_name]) + ret = exe.run(main_program, + fetch_list=[out, b, a.grad_name, b.grad_name]) # Note: fill_constant has loss of precision, you have to assertEqual # with values doens't lose precision in float-point number. - self.assertEqual(ret[0][0], 1.25) - self.assertEqual(ret[1][0], 0.0) - self.assertEqual(ret[2][0], 1.0) + self.assertEqual(ret[0][0], ret[1][0]) + self.assertEqual(ret[2][0], 0.0) + self.assertEqual(ret[3][0], 1.0) class TestCondNestedControlFlow(unittest.TestCase): -- GitLab