Skip to content

Commit 82a8e08

Browse files
committed
update comment of executor.run
1 parent 5dbb71b commit 82a8e08

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

python/paddle/fluid/executor.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,22 @@ def run(self,
228228
scope=None,
229229
return_numpy=True,
230230
use_program_cache=False):
231-
"""
232-
:param program: the program that need to run
233-
:param feed: feed variable list
234-
:param fetch_list: fetch variable list
235-
:param feed_var_name: feed_var_name default to 'feed'
236-
:param fetch_var_name: fetch_var_name default to 'fetch'
237-
:param scope: the scope used to run this program, you can switch it to different scope.
238-
:param return_numpy: convert the fetched tensor to numpy
231+
""" Run program by this Executor. Feed data by feed map, fetch result by fetch_list.
232+
233+
Python executor takes a program, add feed operators and fetch operators to this program according
234+
to feed map and fetch_list. Feed map provides input data for the program. fetch_list provides
235+
the variables that user want to get after program run. Note: the executor will run all
236+
operators in the program but not only the operators dependent by the fetch_list
237+
238+
:param program: the program that need to run, if not provied, then default_main_program will be used.
239+
:param feed: feed variable map, e.g. {"image": ImageData, "label": LableData}
240+
:param fetch_list: a list of variable that user want to get, run will return them according to this list.
241+
:param feed_var_name: the name for the input variable of feed Operator.
242+
:param fetch_var_name: the name for the output variable of feed Operator.
243+
:param scope: the scope used to run this program, you can switch it to different scope. default is global_scope
244+
:param return_numpy: if convert the fetched tensor to numpy
239245
:param use_program_cache: set use_program_cache to true if program not changed compare to the last step.
240-
:return:
246+
:return: result according to fetch_list.
241247
"""
242248
if feed is None:
243249
feed = {}

0 commit comments

Comments
 (0)