From cb0b53cbbc1c52643238a48e3c2dca873c4d169b Mon Sep 17 00:00:00 2001 From: hong <43953930+phlrain@users.noreply.github.com> Date: Thu, 25 Aug 2022 20:22:42 +0800 Subject: [PATCH] fix auto tune unitest assert (#45421) --- python/paddle/fluid/tests/unittests/test_switch_autotune.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_switch_autotune.py b/python/paddle/fluid/tests/unittests/test_switch_autotune.py index 3daf8752d8c..93dd06ec291 100644 --- a/python/paddle/fluid/tests/unittests/test_switch_autotune.py +++ b/python/paddle/fluid/tests/unittests/test_switch_autotune.py @@ -90,9 +90,9 @@ class TestAutoTune(unittest.TestCase): for key in status.keys(): v = status[key] if key == "cache_hit_rate": - self.assertTrue(np.allclose(v, expected_res[key])) + np.testing.assert_allclose(v, expected_res[key]) else: - self.assertEqual(v, expected_res[key]) + np.testing.assert_array_equal(v, expected_res[key]) class TestDygraphAutoTuneStatus(TestAutoTune): -- GitLab