Skip to content

Commit 81b66db

Browse files
authored
Merge pull request #14773 from chengduoZH/fix_io_and_data_feeder_doc
Fix io and data feeder doc
2 parents a9aebfa + 1a55b5f commit 81b66db

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

python/paddle/fluid/data_feeder.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,13 @@ def decorate_reader(self,
258258
multiple mini-batches. Each mini-batch will be feed on each device.
259259
260260
Args:
261-
reader(fun): the input data.
262-
multi_devices(bool): the number of places. Default None.
263-
num_places(int): the number of places. Default None.
264-
drop_last(bool): the number of places. Default None.
261+
reader(function): the reader is the function which can generate data.
262+
multi_devices(bool): whether to use multiple devices or not.
263+
num_places(int): if the multi_devices is True, you can specify the number
264+
of GPU to use, if 'num_places' is None, the function will use all the
265+
GPU of the current machine. Default None.
266+
drop_last(bool): whether to drop the last batch if the
267+
size of the last batch is less than batch_size. Default True.
265268
266269
Returns:
267270
dict: the result of conversion.

python/paddle/fluid/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def name_has_fc(var):
145145
146146
prog = fluid.default_main_program()
147147
fluid.io.save_vars(executor=exe, dirname=path, main_program=prog,
148-
vars=None)
148+
vars=None, predicate = name_has_fc)
149149
# All variables in `main_program` whose name includes "fc" will be saved.
150150
# And variables are going to be saved separately.
151151
@@ -369,7 +369,7 @@ def name_has_fc(var):
369369
370370
prog = fluid.default_main_program()
371371
fluid.io.load_vars(executor=exe, dirname=path, main_program=prog,
372-
vars=None)
372+
vars=None, predicate=name_has_fc)
373373
# All variables in `main_program` whose name includes "fc" will be loaded.
374374
# And all the variables are supposed to have been saved in differnet files.
375375

0 commit comments

Comments
 (0)