update the test_mean test case for bug fix

update the test_mean test case
test_feature_precision_test_c
wawltor 5 years ago committed by GitHub
parent c10cf6d240
commit 1080be3353
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -101,7 +101,7 @@ class TestMeanAPI(unittest.TestCase):
fetch_list=[out1, out2, out3, out4, out5])
out_ref = np.mean(self.x)
for out in res:
self.assertEqual(np.allclose(out, out_ref), True)
self.assertEqual(np.allclose(out, out_ref, rtol=1e-04), True)
def test_api_dygraph(self):
paddle.disable_static(self.place)
@ -114,7 +114,9 @@ class TestMeanAPI(unittest.TestCase):
if len(axis) == 0:
axis = None
out_ref = np.mean(x, axis, keepdims=keepdim)
self.assertEqual(np.allclose(out.numpy(), out_ref), True)
self.assertEqual(
np.allclose(
out.numpy(), out_ref, rtol=1e-04), True)
test_case(self.x)
test_case(self.x, [])

Loading…
Cancel
Save