diff --git a/python/paddle/fluid/tests/unittests/test_switch_autotune.py b/python/paddle/fluid/tests/unittests/test_switch_autotune.py index 3daf8752d8c086bab04a8d4545175e689f133b34..93dd06ec2916a578639ccf2e011cfbb92aba08f4 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):