Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
618a0141
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
618a0141
编写于
3月 11, 2019
作者:
Z
Zeng Jinle
提交者:
GitHub
3月 11, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15995 from sneaxiy/release/1.3-fix-executor-doc
Fix release/1.3 Executor doc
上级
b1e56994
5d22b8f1
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
34 addition
and
34 deletion
+34
-34
python/paddle/fluid/executor.py
python/paddle/fluid/executor.py
+34
-34
未找到文件。
python/paddle/fluid/executor.py
浏览文件 @
618a0141
...
@@ -261,20 +261,20 @@ def _as_lodtensor(data, place):
...
@@ -261,20 +261,20 @@ def _as_lodtensor(data, place):
class
Executor
(
object
):
class
Executor
(
object
):
"""
"""
An Executor in Python, only support the single-GPU running. For multi-cards, please refer to
An Executor in Python, supports single/multiple-GPU running, and single/multiple-CPU running.
ParallelExecutor.
Python executor takes a program, adds feed operators and fetch operators to this program according
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
to feed map and fetch_list. Feed map provides input data for the program. fetch_list provides
the variables(or names) that user want
to get after program run
. Note: the executor will run all
the variables(or names) that user want
s to get after program runs
. Note: the executor will run all
operators in the program but not only the operators dependent by the fetch_list.
operators in the program but not only the operators dependent by the fetch_list.
It store the global variables into the global scope, and create a local scope for the temporary
It stores the global variables into the global scope, and creates a local scope for the temporary
variables. The local scope contents will be discarded after every minibatch forward/backward finished.
variables. The contents in local scope may be discarded after every minibatch forward/backward
But the global scope variables will be persistent through different runs.
finished. But the global scope variables will be persistent through different runs.
All of ops in program will be running in sequence.
Example:
Example:
.. code-block:: python
.. code-block:: python
# First create the Executor.
# First create the Executor.
place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace()
place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace()
exe = fluid.Executor(place)
exe = fluid.Executor(place)
...
@@ -297,9 +297,6 @@ class Executor(object):
...
@@ -297,9 +297,6 @@ class Executor(object):
Args:
Args:
place(core.CPUPlace|core.CUDAPlace(n)): indicate the executor run on which device
place(core.CPUPlace|core.CUDAPlace(n)): indicate the executor run on which device
Note: For debugging complicated network in parallel-GPUs, you can test it on the executor.
They has the exactly same arguments, and expected the same results.
"""
"""
def
__init__
(
self
,
place
):
def
__init__
(
self
,
place
):
...
@@ -382,6 +379,12 @@ class Executor(object):
...
@@ -382,6 +379,12 @@ class Executor(object):
]
]
return
outs
return
outs
'''
TODO(typhoonzero): Define "no longer use" meaning? Can user create
a new Executor for the same program and run?
TODO(panyx0718): Why ParallelExecutor doesn't have close?
'''
def
close
(
self
):
def
close
(
self
):
"""
"""
Close this executor.
Close this executor.
...
@@ -389,9 +392,6 @@ class Executor(object):
...
@@ -389,9 +392,6 @@ class Executor(object):
You can no longer use this executor after calling this method.
You can no longer use this executor after calling this method.
For the distributed training, this method would free the resource on PServers related to
For the distributed training, this method would free the resource on PServers related to
the current Trainer.
the current Trainer.
TODO(typhoonzero): Define "no longer use" meaning? Can user create
a new Executor for the same program and run?
TODO(panyx0718): Why ParallelExecutor doesn't have close?
Example:
Example:
>>> cpu = core.CPUPlace()
>>> cpu = core.CPUPlace()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录