From 82a8e080cb162e6685b33aa7152f9a53820272b5 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Tue, 6 Mar 2018 11:06:11 +0800 Subject: [PATCH] update comment of executor.run --- python/paddle/fluid/executor.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index bd2de4e9781..98f28938fe6 100644 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -228,16 +228,22 @@ class Executor(object): scope=None, return_numpy=True, use_program_cache=False): - """ - :param program: the program that need to run - :param feed: feed variable list - :param fetch_list: fetch variable list - :param feed_var_name: feed_var_name default to 'feed' - :param fetch_var_name: fetch_var_name default to 'fetch' - :param scope: the scope used to run this program, you can switch it to different scope. - :param return_numpy: convert the fetched tensor to numpy + """ Run program by this Executor. Feed data by feed map, fetch result by fetch_list. + + Python executor takes a program, add feed operators and fetch operators to this program according + to feed map and fetch_list. Feed map provides input data for the program. fetch_list provides + the variables that user want to get after program run. Note: the executor will run all + operators in the program but not only the operators dependent by the fetch_list + + :param program: the program that need to run, if not provied, then default_main_program will be used. + :param feed: feed variable map, e.g. {"image": ImageData, "label": LableData} + :param fetch_list: a list of variable that user want to get, run will return them according to this list. + :param feed_var_name: the name for the input variable of feed Operator. + :param fetch_var_name: the name for the output variable of feed Operator. + :param scope: the scope used to run this program, you can switch it to different scope. default is global_scope + :param return_numpy: if convert the fetched tensor to numpy :param use_program_cache: set use_program_cache to true if program not changed compare to the last step. - :return: + :return: result according to fetch_list. """ if feed is None: feed = {} -- GitLab