提交 ecc4dc6d 编写于 作者: Y yuyang

Hide RecordIO Reader

上级 3fbfcd9c
......@@ -290,14 +290,6 @@ Recv
.. autofunction:: paddle.fluid.layers.Recv
:noindex:
.. _api_fluid_layers_open_recordio_file:
open_recordio_file
------------------
.. autofunction:: paddle.fluid.layers.open_recordio_file
:noindex:
.. _api_fluid_layers_open_files:
open_files
......
......@@ -29,9 +29,8 @@ from ..layer_helper import LayerHelper
from ..unique_name import generate as unique_name
__all__ = [
'data', 'open_recordio_file', 'open_files', 'read_file', 'shuffle', 'batch',
'double_buffer', 'random_data_generator', 'py_reader', 'Preprocessor',
'load'
'data', 'open_files', 'read_file', 'shuffle', 'batch', 'double_buffer',
'random_data_generator', 'py_reader', 'Preprocessor', 'load'
]
......
......@@ -19,6 +19,7 @@ import unittest
import paddle.fluid as fluid
import paddle
import paddle.dataset.mnist as mnist
from paddle.fluid.layers.io import open_recordio_file
class TestMultipleReader(unittest.TestCase):
......@@ -41,7 +42,7 @@ class TestMultipleReader(unittest.TestCase):
def test_main(self):
with fluid.program_guard(fluid.Program(), fluid.Program()):
data_file = fluid.layers.open_recordio_file(
data_file = open_recordio_file(
filename='./mnist.recordio',
shapes=[(-1, 784), (-1, 1)],
lod_levels=[0, 0],
......
......@@ -20,6 +20,7 @@ import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.dataset.mnist as mnist
from paddle.fluid.layers.io import open_recordio_file
class TestPreprocessor(unittest.TestCase):
......@@ -43,7 +44,7 @@ class TestPreprocessor(unittest.TestCase):
img_expected_res = []
lbl_expected_res = []
with fluid.program_guard(fluid.Program(), fluid.Program()):
data_file = fluid.layers.io.open_recordio_file(
data_file = open_recordio_file(
'./mnist_for_preprocessor_test.recordio',
shapes=[[-1, 784], [-1, 1]],
lod_levels=[0, 0],
......@@ -64,7 +65,7 @@ class TestPreprocessor(unittest.TestCase):
img_actual_res = []
lbl_actual_res = []
with fluid.program_guard(fluid.Program(), fluid.Program()):
data_file = fluid.layers.io.open_recordio_file(
data_file = open_recordio_file(
'./mnist_for_preprocessor_test.recordio',
shapes=[[-1, 784], [-1, 1]],
lod_levels=[0, 0],
......
......@@ -19,6 +19,7 @@ import unittest
import paddle.fluid as fluid
import paddle
import paddle.dataset.mnist as mnist
from paddle.fluid.layers.io import open_recordio_file
class TestRecordIO(unittest.TestCase):
......@@ -40,7 +41,7 @@ class TestRecordIO(unittest.TestCase):
def test_main(self, decorator_callback=None):
# use new program
with fluid.program_guard(fluid.Program(), fluid.Program()):
data_file = fluid.layers.open_recordio_file(
data_file = open_recordio_file(
'./mnist.recordio',
shapes=[[-1, 784], [-1, 1]],
lod_levels=[0, 0],
......
......@@ -19,6 +19,7 @@ import numpy as np
import paddle.fluid as fluid
import paddle.fluid.layers as layers
from paddle.fluid.layers.io import open_recordio_file
pos_enc_param_names = (
"src_pos_enc_table",
......@@ -405,7 +406,7 @@ def transformer(
src_pad_idx,
trg_pad_idx,
pos_pad_idx, ):
file_obj = fluid.layers.open_recordio_file(
file_obj = open_recordio_file(
filename='/tmp/wmt16.recordio',
shapes=[
[batch_size * max_length, 1],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册