Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
261d5f02
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
261d5f02
编写于
6月 15, 2018
作者:
X
Xin Pan
提交者:
GitHub
6月 15, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11409 from panyx0718/doc
Add API docs.
上级
f4dce567
c1843fd2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
49 addition
and
1 deletion
+49
-1
paddle/fluid/operators/get_places_op.cc
paddle/fluid/operators/get_places_op.cc
+1
-1
python/paddle/fluid/layers/control_flow.py
python/paddle/fluid/layers/control_flow.py
+28
-0
python/paddle/fluid/layers/io.py
python/paddle/fluid/layers/io.py
+20
-0
未找到文件。
paddle/fluid/operators/get_places_op.cc
浏览文件 @
261d5f02
...
...
@@ -85,7 +85,7 @@ class GetPlacesOpProtoMaker : public framework::OpProtoAndCheckerMaker {
.
InEnum
({
"CUDA"
,
"CPU"
,
"AUTO"
})
.
SetDefault
(
"AUTO"
);
AddComment
(
R"DOC(
Returns a list of places based on
flag
s. The list will be used for parallel
Returns a list of places based on
argument
s. The list will be used for parallel
execution.
)DOC"
);
}
...
...
python/paddle/fluid/layers/control_flow.py
浏览文件 @
261d5f02
...
...
@@ -1209,6 +1209,34 @@ class IfElseBlockGuard(object):
class
IfElse
(
object
):
"""
if-else control flow.
Args:
cond (Variable): condition used to compare.
name (str, default None): The name of this layer.
Examples:
.. code-block:: python
limit = fluid.layers.fill_constant_batch_size_like(
input=label, dtype='int64', shape=[1], value=5.0)
cond = fluid.layers.less_than(x=label, y=limit)
ie = fluid.layers.IfElse(cond)
with ie.true_block():
true_image = ie.input(image)
hidden = fluid.layers.fc(input=true_image, size=100, act='tanh')
prob = fluid.layers.fc(input=hidden, size=10, act='softmax')
ie.output(prob)
with ie.false_block():
false_image = ie.input(image)
hidden = fluid.layers.fc(
input=false_image, size=200, act='tanh')
prob = fluid.layers.fc(input=hidden, size=10, act='softmax')
ie.output(prob)
prob = ie()
"""
OUT_IF_ELSE_BLOCKS
=
0
IN_IF_ELSE_TRUE_BLOCKS
=
1
IN_IF_ELSE_FALSE_BLOCKS
=
2
...
...
python/paddle/fluid/layers/io.py
浏览文件 @
261d5f02
...
...
@@ -587,6 +587,26 @@ def read_file(file_obj):
class
Preprocessor
(
object
):
"""
A block for data pre-processing in reader.
Args:
reader (Variable): A reader variable.
name (str, default None): The name of the reader.
Examples:
.. code-block:: python
preprocessor = fluid.layers.io.Preprocessor(reader=reader)
with preprocessor.block():
img, lbl = preprocessor.inputs()
img_out = img / 2
lbl_out = lbl + 1
preprocessor.outputs(img_out, lbl_out)
data_file = fluid.layers.io.double_buffer(preprocessor())
"""
BEFORE_SUB_BLOCK
=
0
IN_SUB_BLOCK
=
1
AFTER_SUB_BLOCK
=
2
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录