From dcdd2903febed84838162b89ee770789deb43183 Mon Sep 17 00:00:00 2001 From: qijun Date: Fri, 4 Aug 2017 18:19:20 +0800 Subject: [PATCH] use isclose instead of assert_almost_equal --- python/paddle/v2/framework/tests/op_test_util.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/paddle/v2/framework/tests/op_test_util.py b/python/paddle/v2/framework/tests/op_test_util.py index 98fae1b97..9ee66c2c5 100644 --- a/python/paddle/v2/framework/tests/op_test_util.py +++ b/python/paddle/v2/framework/tests/op_test_util.py @@ -61,10 +61,7 @@ class OpTestMeta(type): for out_name in func.all_output_args: actual = numpy.array(scope.find_var(out_name).get_tensor()) expect = getattr(self, out_name) - # TODO(qijun) The default decimal is 7, but numpy.dot and eigen.mul - # has some diff, and could not pass unittest. So I set decimal 3 here. - # And I will check this in future. - numpy.testing.assert_almost_equal(actual, expect, decimal=3) + numpy.isclose(actual, expect) obj.test_all = test_all return obj -- GitLab