Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
9d36643f
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看板
未验证
提交
9d36643f
编写于
10月 11, 2019
作者:
L
lijianshe02
提交者:
GitHub
10月 11, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix read_file, is_empty, Print API EN doc (#20492) (#20507)
* fix Print, is_empty, read_file test=document_fix
上级
9eb84776
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
17 addition
and
20 deletion
+17
-20
paddle/fluid/API.spec
paddle/fluid/API.spec
+3
-3
python/paddle/fluid/layers/control_flow.py
python/paddle/fluid/layers/control_flow.py
+12
-15
python/paddle/fluid/layers/io.py
python/paddle/fluid/layers/io.py
+2
-2
未找到文件。
paddle/fluid/API.spec
浏览文件 @
9d36643f
...
...
@@ -309,7 +309,7 @@ paddle.fluid.layers.hard_swish (ArgSpec(args=['x', 'threshold', 'scale', 'offset
paddle.fluid.layers.mse_loss (ArgSpec(args=['input', 'label'], varargs=None, keywords=None, defaults=None), ('document', 'd9ede6469288636e1b3233b461a165c9'))
paddle.fluid.layers.uniform_random (ArgSpec(args=['shape', 'dtype', 'min', 'max', 'seed'], varargs=None, keywords=None, defaults=('float32', -1.0, 1.0, 0)), ('document', '126ede8ce0e751244b1b54cd359c89d7'))
paddle.fluid.layers.data (ArgSpec(args=['name', 'shape', 'append_batch_size', 'dtype', 'lod_level', 'type', 'stop_gradient'], varargs=None, keywords=None, defaults=(True, 'float32', 0, VarType.LOD_TENSOR, True)), ('document', '9d7806e31bdf727c1a23b8782a09b545'))
paddle.fluid.layers.read_file (ArgSpec(args=['reader'], varargs=None, keywords=None, defaults=None), ('document', '
88367daf9a30c9ab83adc5d7221e23ef
'))
paddle.fluid.layers.read_file (ArgSpec(args=['reader'], varargs=None, keywords=None, defaults=None), ('document', '
d5b41c7b2df1b064fbd42dcf435268cd
'))
paddle.fluid.layers.double_buffer (ArgSpec(args=['reader', 'place', 'name'], varargs=None, keywords=None, defaults=(None, None)), ('document', '556fa82daf62cbb0fb393f4125daba77'))
paddle.fluid.layers.py_reader (ArgSpec(args=['capacity', 'shapes', 'dtypes', 'lod_levels', 'name', 'use_double_buffer'], varargs=None, keywords=None, defaults=(None, None, True)), ('document', 'd78a1c7344955c5caed8dc13adb7beb6'))
paddle.fluid.layers.create_py_reader_by_data (ArgSpec(args=['capacity', 'feed_list', 'name', 'use_double_buffer'], varargs=None, keywords=None, defaults=(None, True)), ('document', '2edf37d57862b24a7a26aa19a3573f73'))
...
...
@@ -380,8 +380,8 @@ paddle.fluid.layers.StaticRNN.step_input (ArgSpec(args=['self', 'x'], varargs=No
paddle.fluid.layers.StaticRNN.step_output (ArgSpec(args=['self', 'o'], varargs=None, keywords=None, defaults=None), ('document', '252890d4c3199a7623ab8667e13fd837'))
paddle.fluid.layers.StaticRNN.update_memory (ArgSpec(args=['self', 'mem', 'var'], varargs=None, keywords=None, defaults=None), ('document', '7a0000520f179f35239956a5ba55119f'))
paddle.fluid.layers.reorder_lod_tensor_by_rank (ArgSpec(args=['x', 'rank_table'], varargs=None, keywords=None, defaults=None), ('document', 'db67cfcdd20ff6380d125a7553d62121'))
paddle.fluid.layers.Print (ArgSpec(args=['input', 'first_n', 'message', 'summarize', 'print_tensor_name', 'print_tensor_type', 'print_tensor_shape', 'print_tensor_lod', 'print_phase'], varargs=None, keywords=None, defaults=(-1, None, 20, True, True, True, True, 'both')), ('document', '
3130bed32922b9fd84ce2dea6250f635
'))
paddle.fluid.layers.is_empty (ArgSpec(args=['x', 'cond'], varargs=None, keywords=None, defaults=(None,)), ('document', '
3011dc695f490afdf504dc24f628319
a'))
paddle.fluid.layers.Print (ArgSpec(args=['input', 'first_n', 'message', 'summarize', 'print_tensor_name', 'print_tensor_type', 'print_tensor_shape', 'print_tensor_lod', 'print_phase'], varargs=None, keywords=None, defaults=(-1, None, 20, True, True, True, True, 'both')), ('document', '
e57b87b4d1f9d4a6c7a3f4e6942dea10
'))
paddle.fluid.layers.is_empty (ArgSpec(args=['x', 'cond'], varargs=None, keywords=None, defaults=(None,)), ('document', '
a79576af16e8ce1c6ac61b902b04f10
a'))
paddle.fluid.layers.sigmoid (ArgSpec(args=['x', 'name'], varargs=None, keywords=None, defaults=(None,)), ('document', '7bd26680989f33301a4a68000d5af4b0'))
paddle.fluid.layers.logsigmoid (ArgSpec(args=['x', 'name'], varargs=None, keywords=None, defaults=(None,)), ('document', '047c2af83166a69728be73fc44e9ad9f'))
paddle.fluid.layers.exp (ArgSpec(args=['x', 'name'], varargs=None, keywords=None, defaults=(None,)), ('document', 'f6b0cc458acf7ad822a0c26e72fc22a1'))
...
...
python/paddle/fluid/layers/control_flow.py
浏览文件 @
9d36643f
...
...
@@ -154,17 +154,18 @@ def Print(input,
Args:
input (Variable): A Tensor to print.
summarize (int):
Print this number of elements in the tensor, will print
all if left is negative
.
summarize (int):
Number of elements in the tensor to be print. If it's
vaule is -1, then all elements in the tensor will be print
.
message (str): A string message to print as a prefix.
first_n (int): Only log `first_n` number of times.
print_tensor_name (bool
): Print the tensor nam
e.
print_tensor_type (bool
): Print the tensor typ
e.
print_tensor_shape (bool
): Print the tensor shap
e.
print_tensor_lod (bool
): Print the tensor lod
.
print_tensor_name (bool
, optional): Print the tensor name. Default: Tru
e.
print_tensor_type (bool
, optional): Print the tensor type. Defaultt: Tru
e.
print_tensor_shape (bool
, optional): Print the tensor shape. Default: Tru
e.
print_tensor_lod (bool
, optional): Print the tensor lod. Default: True
.
print_phase (str): Which phase to displace, including 'forward',
'backward' and 'both'. If set to 'backward' or 'both', will
print the gradients of input tensor.
'backward' and 'both'. Default: 'both'. If set to 'backward', will
only print the gradients of input tensor; If set to 'both', will
both print the input tensor itself and the gradients of input tensor.
Returns:
Variable: Output tensor.
...
...
@@ -189,16 +190,12 @@ def Print(input,
Output at runtime:
.. code-block:: bash
1564546375
The content of input layer: The place is:CPUPlace
The content of input layer: The place is:CPUPlace
Tensor[fill_constant_0.tmp_0]
shape: [10,2,]
dtype: x
data: 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
# The information of dtype at runtime may vary in different environments.
# Eg:
# If the dtype='int64' of Tensor y, the corresponding c++ type is int64_t.
# The dtype of output is "x" ("x" is typeid(int64_t).name()) with MacOS and gcc4.8.2
'''
helper
=
LayerHelper
(
'print'
+
"_"
+
input
.
name
,
**
locals
())
output
=
helper
.
create_variable_for_type_inference
(
input
.
dtype
)
...
...
@@ -2589,8 +2586,8 @@ def is_empty(x, cond=None):
Args:
x (Variable): The Variable to be tested.
cond (Variable
|None): Output parameter. Returns the test resul
t
of given 'x'. Default: None
cond (Variable
, optional): Output parameter. Default: None. If this parameter is given, i
t
saves the test result of given 'x'.
Returns:
Variable: A bool scalar. True if 'x' is an empty Variable.
...
...
python/paddle/fluid/layers/io.py
浏览文件 @
9d36643f
...
...
@@ -825,14 +825,14 @@ def read_file(reader):
A reader is also a Variable. It can be a raw reader generated by
`fluid.layers.open_files()` or a decorated one generated by
`fluid.layers.double_buffer()`
and so on
.
`fluid.layers.double_buffer()` .
Args:
reader(Variable): The reader to execute.
Returns:
Tuple[Variable]: Data read
via
the given reader.
Tuple[Variable]: Data read
from
the given reader.
Examples:
.. code-block:: python
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录