From 9fa87b23d950b6bb1abe9ad6ca39ae6800293338 Mon Sep 17 00:00:00 2001 From: chengduo Date: Fri, 7 Dec 2018 17:22:26 +0800 Subject: [PATCH] Fix io doc (#14751) * fix io doc test=develop * refine data_feeder doc test=develop --- python/paddle/fluid/data_feeder.py | 11 +++++++---- python/paddle/fluid/io.py | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/python/paddle/fluid/data_feeder.py b/python/paddle/fluid/data_feeder.py index 5102a558fd..13d2893fd1 100644 --- a/python/paddle/fluid/data_feeder.py +++ b/python/paddle/fluid/data_feeder.py @@ -258,10 +258,13 @@ class DataFeeder(object): multiple mini-batches. Each mini-batch will be feed on each device. Args: - reader(fun): the input data. - multi_devices(bool): the number of places. Default None. - num_places(int): the number of places. Default None. - drop_last(bool): the number of places. Default None. + reader(function): the reader is the function which can generate data. + multi_devices(bool): whether to use multiple devices or not. + num_places(int): if the multi_devices is True, you can specify the number + of GPU to use, if 'num_places' is None, the function will use all the + GPU of the current machine. Default None. + drop_last(bool): whether to drop the last batch if the + size of the last batch is less than batch_size. Default True. Returns: dict: the result of conversion. diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index 0782933c6c..e74a87fc68 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -145,7 +145,7 @@ def save_vars(executor, prog = fluid.default_main_program() fluid.io.save_vars(executor=exe, dirname=path, main_program=prog, - vars=None) + vars=None, predicate = name_has_fc) # All variables in `main_program` whose name includes "fc" will be saved. # And variables are going to be saved separately. @@ -369,7 +369,7 @@ def load_vars(executor, prog = fluid.default_main_program() fluid.io.load_vars(executor=exe, dirname=path, main_program=prog, - vars=None) + vars=None, predicate=name_has_fc) # All variables in `main_program` whose name includes "fc" will be loaded. # And all the variables are supposed to have been saved in differnet files. -- GitLab