Skip to content

Commit 713d5a4

Browse files
authored
Hotfix Release 2.3 Bug for CUDA 11.2 (#42438)
* Fix Release 2.3 Bug * Fix format
1 parent 655c498 commit 713d5a4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/paddle/fluid/tests/unittests/test_cond.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,13 @@ def test_extremely_simple_net_with_op_in_condition(self):
235235
place = fluid.CUDAPlace(0) if core.is_compiled_with_cuda(
236236
) else fluid.CPUPlace()
237237
exe = fluid.Executor(place)
238-
ret = exe.run(main_program, fetch_list=[out, a.grad_name, b.grad_name])
238+
ret = exe.run(main_program,
239+
fetch_list=[out, b, a.grad_name, b.grad_name])
239240
# Note: fill_constant has loss of precision, you have to assertEqual
240241
# with values doens't lose precision in float-point number.
241-
self.assertEqual(ret[0][0], 1.25)
242-
self.assertEqual(ret[1][0], 0.0)
243-
self.assertEqual(ret[2][0], 1.0)
242+
self.assertEqual(ret[0][0], ret[1][0])
243+
self.assertEqual(ret[2][0], 0.0)
244+
self.assertEqual(ret[3][0], 1.0)
244245

245246

246247
class TestCondNestedControlFlow(unittest.TestCase):

0 commit comments

Comments
 (0)