提交 a305cb21 编写于 作者: Y Yu Yang

Use new program when unittest

上级 9d4c93a0
...@@ -21,7 +21,7 @@ import paddle.v2 as paddle ...@@ -21,7 +21,7 @@ import paddle.v2 as paddle
class TestRecordIO(unittest.TestCase): class TestRecordIO(unittest.TestCase):
def setUp(self): def setUp(self):
# Convert mnist to recordio file # Convert mnist to recordio file
with fluid.program_guard(fluid.Program()): with fluid.program_guard(fluid.Program(), fluid.Program()):
reader = paddle.batch(mnist.train(), batch_size=32) reader = paddle.batch(mnist.train(), batch_size=32)
feeder = fluid.DataFeeder( feeder = fluid.DataFeeder(
feed_list=[ # order is image and label feed_list=[ # order is image and label
...@@ -35,6 +35,8 @@ class TestRecordIO(unittest.TestCase): ...@@ -35,6 +35,8 @@ class TestRecordIO(unittest.TestCase):
'./mnist.recordio', reader, feeder) './mnist.recordio', reader, feeder)
def test_main(self): def test_main(self):
# use new program
with fluid.program_guard(fluid.Program(), fluid.Program()):
data_file = fluid.layers.open_recordio_file( data_file = fluid.layers.open_recordio_file(
'./mnist.recordio', './mnist.recordio',
shapes=[[-1, 784], [-1, 1]], shapes=[[-1, 784], [-1, 1]],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册