未验证 提交 18f2ea66 编写于 作者: K Kaipeng Deng 提交者: GitHub

remove paddle.readers API (#26727)

* remove paddle.readers API. test=develop
上级 f4c750d7
......@@ -204,7 +204,6 @@ from .tensor.math import prod #DEFINE_ALIAS
from .tensor.random import standard_normal
from .tensor.random import normal
from .tensor.random import uniform #DEFINE_ALIAS
from .tensor.random import shuffle #DEFINE_ALIAS
from .tensor.random import randn #DEFINE_ALIAS
from .tensor.random import rand #DEFINE_ALIAS
from .tensor.random import randint #DEFINE_ALIAS
......
......@@ -37,7 +37,7 @@ from .common import download
import tarfile
import scipy.io as scio
from paddle.dataset.image import *
from paddle.reader import *
from paddle.reader import map_readers, xmap_readers
from paddle import compat as cpt
import os
import numpy as np
......
......@@ -26,13 +26,13 @@ from functools import reduce
import numpy as np
import paddle
import paddle.reader
from paddle.reader import *
from paddle.fluid import layers
from paddle.fluid.executor import Executor, global_scope
from paddle.fluid.evaluator import Evaluator
from paddle.fluid.framework import Program, Parameter, default_main_program, default_startup_program, Variable, \
program_guard, dygraph_not_support
from paddle.reader import cache, map_readers, buffered, compose, chain, shuffle, \
ComposeNotAligned, firstn, xmap_readers, multiprocess_reader
from .wrapped_decorator import signature_safe_contextmanager
from paddle.fluid.compiler import CompiledProgram
from paddle.fluid.log_helper import get_logger
......@@ -62,7 +62,7 @@ __all__ = [
'set_program_state',
'get_program_parameter',
'get_program_persistable_vars',
] + reader.__all__ + paddle.reader.__all__
] + reader.__all__
_logger = get_logger(
__name__, logging.INFO, fmt='%(asctime)s-%(levelname)s: %(message)s')
......
......@@ -37,7 +37,7 @@ class TestClass(unittest.TestCase):
low=0, high=9, size=label_shape).astype('int64')
yield img, label
reader = fluid.io.cache(fake_reader)
reader = paddle.reader.cache(fake_reader)
batch_reader = fluid.io.batch(reader, batch_size=batch_size)
places = [fluid.CPUPlace()]
......
......@@ -592,7 +592,7 @@ class TestStarGANWithGradientPenalty(unittest.TestCase):
cfg = Config(place)
dataset = create_mnist_dataset(cfg)
dataset = fluid.io.cache(dataset)
dataset = paddle.reader.cache(dataset)
static_graph_model = StaticGraphTrainModel(cfg)
static_loss = []
......
......@@ -12,8 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.fluid as fluid
from paddle.fluid.io import multiprocess_reader
from paddle.reader import multiprocess_reader
import unittest
import numpy as np
import six
......
......@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.fluid as fluid
import unittest
import numpy as np
......@@ -60,8 +61,8 @@ class TestPyReaderCombination(unittest.TestCase):
py_reader2 = fluid.io.PyReader(
feed_list=[image, label], capacity=16, iterable=True)
reader1 = fluid.io.cache(self.create_reader(self.n1))
reader2 = fluid.io.cache(self.create_reader(self.n2))
reader1 = paddle.reader.cache(self.create_reader(self.n1))
reader2 = paddle.reader.cache(self.create_reader(self.n2))
py_reader1.decorate_batch_generator(reader1, places=place)
py_reader2.decorate_batch_generator(reader2, places=place)
......
......@@ -31,15 +31,6 @@ __all__ = [
'set_program_state',
'load_inference_model',
'save_inference_model',
'batch',
'shuffle',
'buffered',
'cache',
'chain',
'firstn',
'compose',
'map_readers',
'xmap_readers'
]
from ..fluid.io import DataLoader
......@@ -47,4 +38,3 @@ from ..fluid.dataloader import Dataset, IterableDataset, BatchSampler, get_worke
TensorDataset, Sampler, SequenceSampler, RandomSampler, DistributedBatchSampler
from ..fluid.io import load, save, load_program_state, set_program_state, \
load_inference_model, save_inference_model, batch
from ..reader import shuffle, buffered, cache, chain, firstn, compose, map_readers, xmap_readers
......@@ -66,4 +66,4 @@ An example implementation for multiple item data reader creator:
import paddle.reader.decorator
from paddle.reader.decorator import *
__all__ = decorator.__all__
__all__ = []
......@@ -171,7 +171,6 @@ from .math import prod #DEFINE_ALIAS
from .random import standard_normal
from .random import normal
from .random import uniform #DEFINE_ALIAS
from .random import shuffle #DEFINE_ALIAS
from .random import randn #DEFINE_ALIAS
from .random import rand #DEFINE_ALIAS
from .random import randint #DEFINE_ALIAS
......
......@@ -21,14 +21,11 @@ from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtyp
from ..fluid.layers import utils
import paddle
from ..fluid.io import shuffle #DEFINE_ALIAS
__all__ = [
'bernoulli',
'standard_normal',
'normal',
'uniform',
'shuffle',
'randn',
'rand',
'randint',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册