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 baafcdbb80238385752183ee0a8ff96a5da4659c..af487919a9986f0c45651e8825b8cc38231c1904 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)