From 641a7fb342a82d7661a826ca6311e8001a5e5216 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Mon, 6 Aug 2018 22:02:42 +0800 Subject: [PATCH] fix test_initializer --- python/paddle/fluid/tests/unittests/test_initializer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_initializer.py b/python/paddle/fluid/tests/unittests/test_initializer.py index 7947f409ddf..b215e379864 100644 --- a/python/paddle/fluid/tests/unittests/test_initializer.py +++ b/python/paddle/fluid/tests/unittests/test_initializer.py @@ -88,13 +88,13 @@ class TestUniformInitializer(unittest.TestCase): dtype="float32", shape=[5, 10], lod_level=0, - name="param", + name="param1", initializer=initializer.UniformInitializer()) block.create_parameter( dtype="float32", shape=[5, 10], lod_level=0, - name="param", + name="param2", initializer=initializer.UniformInitializer(seed=456)) init_op = block.ops[1] self.assertEqual(init_op.attr("seed"), 123) @@ -136,7 +136,7 @@ class TestUniformInitializer(unittest.TestCase): init_op0 = block.ops[0] self.assertEqual(init_op0.type, 'uniform_random') self.assertAlmostEqual(init_op0.attr('min'), -4.2, delta=DELTA) - self.assertAlmostEqual(init_op0.attr('max'), 1.0, delta=DELTA) + self.assertAlmostEqual(init_op0.attr('max'), 0.0, delta=DELTA) self.assertEqual(init_op0.attr('seed'), 123) -- GitLab