From 33fb153c14129fb690d5933ca982bef1f3cb2eb8 Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Thu, 24 Sep 2020 12:31:15 +0000 Subject: [PATCH] add testing for debug --- .../test_buffer_shared_memory_reuse_pass.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py b/python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py index 2c9168df472..142ee018649 100644 --- a/python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py +++ b/python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py @@ -116,7 +116,11 @@ class InplaceTestBase(unittest.TestCase): feed=feed_dict, fetch_list=[fetch_var]) - self.assertTrue(np.array_equal(fetch_val1, fetch_val2)) + np.testing.assert_array_equal(fetch_val1, fetch_val2) + self.assertTrue( + np.array_equal(fetch_val1, fetch_val2), + "\fetch_val1: {}\fetch_val2: {}".format(fetch_val1, + fetch_val2)) def check_multi_card_fetch_var(self): if self.is_invalid_test(): @@ -160,7 +164,11 @@ class InplaceTestBase(unittest.TestCase): fetch_vals.append(fetch_val) for item in fetch_vals: - self.assertTrue(np.array_equal(fetch_vals[0], item)) + np.testing.assert_array_equal(fetch_vals[0], item) + self.assertTrue( + np.array_equal(fetch_vals[0], item), + "\fetch_vals[0]: {}\item: {}".format(fetch_vals[0], + item)) class CUDAInplaceTest(InplaceTestBase): -- GitLab