From f60b9a4208b34ce42e0e2f5bbc94ee77c5cee90c Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Fri, 11 May 2018 15:14:38 +0800 Subject: [PATCH] fix unittest-error: test_network_with_dtype --- .../paddle/fluid/tests/unittests/test_network_with_dtype.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/tests/unittests/test_network_with_dtype.py b/python/paddle/fluid/tests/unittests/test_network_with_dtype.py index baafcdbb8..af487919a 100644 --- a/python/paddle/fluid/tests/unittests/test_network_with_dtype.py +++ b/python/paddle/fluid/tests/unittests/test_network_with_dtype.py @@ -24,7 +24,7 @@ BATCH_SIZE = 20 class TestNetWithDtype(unittest.TestCase): - def setUp(self): + def set_network(self): self.dtype = "float64" self.init_dtype() self.x = fluid.layers.data(name='x', shape=[13], dtype=self.dtype) @@ -55,12 +55,14 @@ class TestNetWithDtype(unittest.TestCase): pass def test_cpu(self): + self.set_network() place = fluid.CPUPlace() self.run_net_on_place(place) def test_gpu(self): if not core.is_compiled_with_cuda(): return + self.set_network() place = fluid.CUDAPlace(0) self.run_net_on_place(place) -- GitLab