From a243bdfbcf2e2ad718d2140b66964187b4deab9e Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 26 Jun 2017 20:38:18 +0800 Subject: [PATCH] rm not need --- python/paddle/v2/reader/creator.py | 21 +------------------ python/paddle/v2/reader/tests/creator_test.py | 11 ---------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/python/paddle/v2/reader/creator.py b/python/paddle/v2/reader/creator.py index 994062096..07142056f 100644 --- a/python/paddle/v2/reader/creator.py +++ b/python/paddle/v2/reader/creator.py @@ -16,7 +16,7 @@ Creator package contains some simple reader creator, which could be used in user program. """ -__all__ = ['np_array', 'text_file', "RecordIO"] +__all__ = ['np_array', 'text_file'] def np_array(x): @@ -55,22 +55,3 @@ def text_file(path): f.close() return reader - - -def RecordIO(path): - """ - Creates a data reader that outputs record one one by one from given recordio file - :path: path of recordio file - :returns: data reader of recordio file - """ - - def reader(): - f = recordio.reader(path) - while True: - r = f.read() - if r is None: - break - yield r - f.close() - - return reader diff --git a/python/paddle/v2/reader/tests/creator_test.py b/python/paddle/v2/reader/tests/creator_test.py index dd84fbb00..359f3eeef 100644 --- a/python/paddle/v2/reader/tests/creator_test.py +++ b/python/paddle/v2/reader/tests/creator_test.py @@ -13,9 +13,7 @@ # limitations under the License. import os import unittest - import numpy as np - import paddle.v2.reader.creator @@ -36,14 +34,5 @@ class TestTextFile(unittest.TestCase): self.assertEqual(e, str(idx * 2) + " " + str(idx * 2 + 1)) -class TestRecordIO(unittest.TestCase): - def test_RecordIO(self): - path = os.path.join( - os.path.dirname(__file__), "test_recordio_creator.dat") - reader = paddle.v2.reader.creator.RecordIO(path) - for idx, r in enumerate(reader()): - self.assertSequenceEqual(r, str(idx)) - - if __name__ == '__main__': unittest.main() -- GitLab