diff --git a/doc/fluid/user_guides/cv_case/gan/README.cn.md b/doc/fluid/user_guides/cv_case/gan/README.cn.md index 6f79771aead7b8a53255d821f92ef5575e1d2628..40e378c0eb5af72bda915cc7a1467d2bea66ba88 100644 --- a/doc/fluid/user_guides/cv_case/gan/README.cn.md +++ b/doc/fluid/user_guides/cv_case/gan/README.cn.md @@ -312,8 +312,8 @@ batch是一个特殊的decorator,它的输入是一个reader,输出是一个 ```python batch_size = 128 # Minibatch size -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.mnist.train(), buf_size=60000), batch_size=batch_size) ``` diff --git a/doc/fluid/user_guides/cv_case/gan/README.md b/doc/fluid/user_guides/cv_case/gan/README.md index b381dd084685ad912ae443ab8d00d05dd61a5898..b23f1589526b53023e52f70f3e05f4fdb872212b 100644 --- a/doc/fluid/user_guides/cv_case/gan/README.md +++ b/doc/fluid/user_guides/cv_case/gan/README.md @@ -311,8 +311,8 @@ Batch is a special decorator. Its input is a reader and its output is a batched ```python batch_size = 128 # Minibatch size -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.mnist.train(), buf_size=60000), batch_size=batch_size) ``` diff --git a/doc/fluid/user_guides/cv_case/gan/dc_gan.py b/doc/fluid/user_guides/cv_case/gan/dc_gan.py index b5821c15b1967f8ada49e29066e0591c8aec211a..650897a2803cacc4fb31f339f8fb7958a52359ff 100644 --- a/doc/fluid/user_guides/cv_case/gan/dc_gan.py +++ b/doc/fluid/user_guides/cv_case/gan/dc_gan.py @@ -93,13 +93,12 @@ def train(args): exe = fluid.Executor(fluid.CUDAPlace(0)) exe.run(fluid.default_startup_program()) if args.enable_ce: - train_reader = paddle.batch( + train_reader = fluid.io.batch( paddle.dataset.mnist.train(), batch_size=args.batch_size) else: - train_reader = paddle.batch( - paddle.reader.shuffle( - paddle.dataset.mnist.train(), buf_size=60000), + train_reader = fluid.io.batch( + fluid.io.shuffle(paddle.dataset.mnist.train(), buf_size=60000), batch_size=args.batch_size) NUM_TRAIN_TIMES_OF_DG = 2 diff --git a/doc/fluid/user_guides/cv_case/gan/index.cn.html b/doc/fluid/user_guides/cv_case/gan/index.cn.html index 3b3cf0c5aaf659d20d271f2dbfe26d11c5599c0c..625073db5f907b674747138fef927dfa073c93a2 100644 --- a/doc/fluid/user_guides/cv_case/gan/index.cn.html +++ b/doc/fluid/user_guides/cv_case/gan/index.cn.html @@ -354,8 +354,8 @@ batch是一个特殊的decorator,它的输入是一个reader,输出是一个 ```python batch_size = 128 # Minibatch size -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.mnist.train(), buf_size=60000), batch_size=batch_size) ``` diff --git a/doc/fluid/user_guides/cv_case/gan/index.html b/doc/fluid/user_guides/cv_case/gan/index.html index a8de626e97a596e6a535a7afaf33ce82fd68c3ef..f04971c70cf9e3a9a240877d13540b64484e5a74 100644 --- a/doc/fluid/user_guides/cv_case/gan/index.html +++ b/doc/fluid/user_guides/cv_case/gan/index.html @@ -353,8 +353,8 @@ Batch is a special decorator. Its input is a reader and its output is a batched ```python batch_size = 128 # Minibatch size -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.mnist.train(), buf_size=60000), batch_size=batch_size) ``` diff --git a/doc/fluid/user_guides/simple_case/fit_a_line/README.cn.md b/doc/fluid/user_guides/simple_case/fit_a_line/README.cn.md index 69cc494df6608d9e1026efbe618e532b18fba8f3..eb5b8c3446b97dae8fbe3e7879140216513a1120 100644 --- a/doc/fluid/user_guides/simple_case/fit_a_line/README.cn.md +++ b/doc/fluid/user_guides/simple_case/fit_a_line/README.cn.md @@ -143,13 +143,13 @@ import sys ```python BATCH_SIZE = 20 -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.uci_housing.train(), buf_size=500), batch_size=BATCH_SIZE) -test_reader = paddle.batch( - paddle.reader.shuffle( +test_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.uci_housing.test(), buf_size=500), batch_size=BATCH_SIZE) ``` @@ -179,13 +179,13 @@ def reader_creator(train_data): yield d[:-1], d[-1:] return reader -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( reader_creator(train_data), buf_size=500), batch_size=BATCH_SIZE) -test_reader = paddle.batch( - paddle.reader.shuffle( +test_reader = fluid.io.batch( + fluid.io.shuffle( reader_creator(test_data), buf_size=500), batch_size=BATCH_SIZE) ``` @@ -349,7 +349,7 @@ with fluid.scope_guard(inference_scope): fetch_targets] = fluid.io.load_inference_model(params_dirname, infer_exe) # 载入预训练模型 batch_size = 10 - infer_reader = paddle.batch( + infer_reader = fluid.io.batch( paddle.dataset.uci_housing.test(), batch_size=batch_size) # 准备测试集 infer_data = next(infer_reader()) diff --git a/doc/fluid/user_guides/simple_case/fit_a_line/README.md b/doc/fluid/user_guides/simple_case/fit_a_line/README.md index 8760bbf0c6ac488f183a3adedb7bf6cde4058942..2bc2b24c4d8fa3a4bff0ff29d8fb02f4437e8e95 100644 --- a/doc/fluid/user_guides/simple_case/fit_a_line/README.md +++ b/doc/fluid/user_guides/simple_case/fit_a_line/README.md @@ -145,13 +145,13 @@ Next we define the data feeder for training. The data feeder reads a batch of da ```python BATCH_SIZE = 20 -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.uci_housing.train(), buf_size=500), batch_size=BATCH_SIZE) -test_reader = paddle.batch( - paddle.reader.shuffle( +test_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.uci_housing.test(), buf_size=500), batch_size=BATCH_SIZE) ``` @@ -181,13 +181,13 @@ def reader_creator(train_data): yield d[:-1], d[-1:] return reader -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( reader_creator(train_data), buf_size=500), batch_size=BATCH_SIZE) -test_reader = paddle.batch( - paddle.reader.shuffle( +test_reader = fluid.io.batch( + fluid.io.shuffle( reader_creator(test_data), buf_size=500), batch_size=BATCH_SIZE) ``` @@ -351,7 +351,7 @@ with fluid.scope_guard(inference_scope): fetch_targets] = fluid.io.load_inference_model(params_dirname, infer_exe) # load pre-predict model batch_size = 10 - infer_reader = paddle.batch( + infer_reader = fluid.io.batch( paddle.dataset.uci_housing.test(), batch_size=batch_size) # prepare test dataset infer_data = next(infer_reader()) diff --git a/doc/fluid/user_guides/simple_case/fit_a_line/index.cn.html b/doc/fluid/user_guides/simple_case/fit_a_line/index.cn.html index e47cda5f7e74d4e41d0d341fab126712dc78434a..02117e6d41fdcfdae5262cba59f2b8d1ee92a79d 100644 --- a/doc/fluid/user_guides/simple_case/fit_a_line/index.cn.html +++ b/doc/fluid/user_guides/simple_case/fit_a_line/index.cn.html @@ -185,13 +185,13 @@ import sys ```python BATCH_SIZE = 20 -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.uci_housing.train(), buf_size=500), batch_size=BATCH_SIZE) -test_reader = paddle.batch( - paddle.reader.shuffle( +test_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.uci_housing.test(), buf_size=500), batch_size=BATCH_SIZE) ``` @@ -221,13 +221,13 @@ def reader_creator(train_data): yield d[:-1], d[-1:] return reader -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( reader_creator(train_data), buf_size=500), batch_size=BATCH_SIZE) -test_reader = paddle.batch( - paddle.reader.shuffle( +test_reader = fluid.io.batch( + fluid.io.shuffle( reader_creator(test_data), buf_size=500), batch_size=BATCH_SIZE) ``` @@ -391,7 +391,7 @@ with fluid.scope_guard(inference_scope): fetch_targets] = fluid.io.load_inference_model(params_dirname, infer_exe) # 载入预训练模型 batch_size = 10 - infer_reader = paddle.batch( + infer_reader = fluid.io.batch( paddle.dataset.uci_housing.test(), batch_size=batch_size) # 准备测试集 infer_data = next(infer_reader()) diff --git a/doc/fluid/user_guides/simple_case/fit_a_line/index.html b/doc/fluid/user_guides/simple_case/fit_a_line/index.html index 70e7b0eab98652434f4e030e7888d07290176ef3..3496bd7c54d28fa5c96a6e197bec906548698dee 100644 --- a/doc/fluid/user_guides/simple_case/fit_a_line/index.html +++ b/doc/fluid/user_guides/simple_case/fit_a_line/index.html @@ -187,13 +187,13 @@ Next we define the data feeder for training. The data feeder reads a batch of da ```python BATCH_SIZE = 20 -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.uci_housing.train(), buf_size=500), batch_size=BATCH_SIZE) -test_reader = paddle.batch( - paddle.reader.shuffle( +test_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.uci_housing.test(), buf_size=500), batch_size=BATCH_SIZE) ``` @@ -223,13 +223,13 @@ def reader_creator(train_data): yield d[:-1], d[-1:] return reader -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( reader_creator(train_data), buf_size=500), batch_size=BATCH_SIZE) -test_reader = paddle.batch( - paddle.reader.shuffle( +test_reader = fluid.io.batch( + fluid.io.shuffle( reader_creator(test_data), buf_size=500), batch_size=BATCH_SIZE) ``` @@ -393,7 +393,7 @@ with fluid.scope_guard(inference_scope): fetch_targets] = fluid.io.load_inference_model(params_dirname, infer_exe) # load pre-predict model batch_size = 10 - infer_reader = paddle.batch( + infer_reader = fluid.io.batch( paddle.dataset.uci_housing.test(), batch_size=batch_size) # prepare test dataset infer_data = next(infer_reader()) diff --git a/doc/fluid/user_guides/simple_case/fit_a_line/train.py b/doc/fluid/user_guides/simple_case/fit_a_line/train.py index 41dde8b852a01233f2d2bcc695344b3620a39e18..20fe8592da09af8b339df492622c536fde66e1ce 100644 --- a/doc/fluid/user_guides/simple_case/fit_a_line/train.py +++ b/doc/fluid/user_guides/simple_case/fit_a_line/train.py @@ -74,18 +74,16 @@ def main(): batch_size = 20 if args.enable_ce: - train_reader = paddle.batch( + train_reader = fluid.io.batch( paddle.dataset.uci_housing.train(), batch_size=batch_size) - test_reader = paddle.batch( + test_reader = fluid.io.batch( paddle.dataset.uci_housing.test(), batch_size=batch_size) else: - train_reader = paddle.batch( - paddle.reader.shuffle( - paddle.dataset.uci_housing.train(), buf_size=500), + train_reader = fluid.io.batch( + fluid.io.shuffle(paddle.dataset.uci_housing.train(), buf_size=500), batch_size=batch_size) - test_reader = paddle.batch( - paddle.reader.shuffle( - paddle.dataset.uci_housing.test(), buf_size=500), + test_reader = fluid.io.batch( + fluid.io.shuffle(paddle.dataset.uci_housing.test(), buf_size=500), batch_size=batch_size) # feature vector of length 13 @@ -172,7 +170,7 @@ def main(): ] = fluid.io.load_inference_model(params_dirname, infer_exe) batch_size = 10 - infer_reader = paddle.batch( + infer_reader = fluid.io.batch( paddle.dataset.uci_housing.test(), batch_size=batch_size) infer_data = next(infer_reader())