From a22567ebefbd29644603b66f44273bfb33fc8434 Mon Sep 17 00:00:00 2001 From: dongzhihong Date: Wed, 26 Jul 2017 00:51:46 +0800 Subject: [PATCH] "fix almost equal error" --- python/paddle/v2/framework/tests/test_random_op.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/v2/framework/tests/test_random_op.py b/python/paddle/v2/framework/tests/test_random_op.py index e2aa9bdfc..447e3e39a 100644 --- a/python/paddle/v2/framework/tests/test_random_op.py +++ b/python/paddle/v2/framework/tests/test_random_op.py @@ -21,8 +21,8 @@ class TestRandomOp(unittest.TestCase): ctx = core.DeviceContext.cpu_context() op.run(scope, ctx) tensor_array = numpy.array(tensor) - self.assertAlmostEqual(numpy.std(tensor_array), 1.0) - self.assertAlmostEqual(numpy.mean(tensor_array), 5.0) + self.assertAlmostEqual(numpy.mean(tensor_array), 5.0, places=3) + self.assertAlmostEqual(numpy.std(tensor_array), 1.0, places=3) if __name__ == '__main__': -- GitLab