From c6fc6a36035a87925bcedd27eb94b6b11c8a744e Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Thu, 19 Apr 2018 10:13:18 +0800 Subject: [PATCH] fix a bugs --- .../paddle/fluid/tests/unittests/test_multi_file_reader.py | 1 - python/paddle/fluid/tests/unittests/test_recordio_reader.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_multi_file_reader.py b/python/paddle/fluid/tests/unittests/test_multi_file_reader.py index 5dc41e54d61..3f940203b93 100644 --- a/python/paddle/fluid/tests/unittests/test_multi_file_reader.py +++ b/python/paddle/fluid/tests/unittests/test_multi_file_reader.py @@ -69,7 +69,6 @@ class TestMultipleReader(unittest.TestCase): break batch_count += 1 self.assertLessEqual(img_val.shape[0], self.batch_size) - data_files.reset() self.assertEqual(batch_count, self.num_batch * 3) def test_main(self): diff --git a/python/paddle/fluid/tests/unittests/test_recordio_reader.py b/python/paddle/fluid/tests/unittests/test_recordio_reader.py index 7c8e7f634fd..f32050014d7 100644 --- a/python/paddle/fluid/tests/unittests/test_recordio_reader.py +++ b/python/paddle/fluid/tests/unittests/test_recordio_reader.py @@ -74,13 +74,13 @@ class TestRecordIO(unittest.TestCase): avg_loss_np.append(tmp) batch_id += 1 - data_file.reset() self.assertEqual(batch_id, self.num_batches) self.assertLess(avg_loss_np[-1], avg_loss_np[0]) def test_shuffle_reader(self): - self.test_main(decorator_callback=lambda reader: fluid.layers.io.shuffle(reader, buffer_size=200)) + self.test_main(decorator_callback=lambda reader: fluid.layers.io.shuffle( + reader, buffer_size=200)) def test_double_buffer_reader(self): self.test_main(decorator_callback=lambda reader: fluid.layers.io.double_buffer(reader, - place='cuda:0' if fluid.core.is_compiled_with_cuda() else 'cpu')) + place='cuda:0' if fluid.core.is_compiled_with_cuda() else 'cpu')) -- GitLab