Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
FluidDoc
提交
7ac45d03
F
FluidDoc
项目概览
PaddlePaddle
/
FluidDoc
通知
10
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
23
列表
看板
标记
里程碑
合并请求
111
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
FluidDoc
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
23
Issue
23
列表
看板
标记
里程碑
合并请求
111
合并请求
111
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7ac45d03
编写于
9月 24, 2019
作者:
L
lijianshe02
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix print op api doc test=develop
上级
04293dc3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
5 deletion
+6
-5
doc/fluid/api_cn/layers_cn/Print_cn.rst
doc/fluid/api_cn/layers_cn/Print_cn.rst
+6
-5
未找到文件。
doc/fluid/api_cn/layers_cn/Print_cn.rst
浏览文件 @
7ac45d03
...
@@ -7,7 +7,7 @@ Print
...
@@ -7,7 +7,7 @@ Print
**Print操作命令**
**Print操作命令**
该OP创建一个打印操作,打印正在访问的Tensor。
该OP创建一个打印操作,打印正在访问的Tensor
内容
。
封装传入的Tensor,以便无论何时访问Tensor,都会打印信息message和Tensor的当前值。
封装传入的Tensor,以便无论何时访问Tensor,都会打印信息message和Tensor的当前值。
...
@@ -19,15 +19,15 @@ Print
...
@@ -19,15 +19,15 @@ Print
- **print_tensor_name** (bool)-可选,指明是否打印Tensor名称,默认为True
- **print_tensor_name** (bool)-可选,指明是否打印Tensor名称,默认为True
- **print_tensor_type** (bool)-可选,指明是否打印Tensor类型,默认为True
- **print_tensor_type** (bool)-可选,指明是否打印Tensor类型,默认为True
- **print_tensor_shape** (bool)-可选,指明是否打印Tensor维度信息,默认为True
- **print_tensor_shape** (bool)-可选,指明是否打印Tensor维度信息,默认为True
- **print_tensor_lod** (bool)-可选,指明是否打印Tensor的
lod
信息,默认为True
- **print_tensor_lod** (bool)-可选,指明是否打印Tensor的
LoD
信息,默认为True
- **print_phase** (str)-可选,指明打印的阶段,包括 ``forward`` , ``backward`` 和 ``both``
。
默认为 ``both`` 。设置为 ``forward`` 时,只打印Tensor的前向信息;设置为 ``backward`` 时,只打印Tensor的梯度信息;设置为 ``both`` 时,则同时打印Tensor的前向信息以及梯度信息。
- **print_phase** (str)-可选,指明打印的阶段,包括 ``forward`` , ``backward`` 和 ``both``
,
默认为 ``both`` 。设置为 ``forward`` 时,只打印Tensor的前向信息;设置为 ``backward`` 时,只打印Tensor的梯度信息;设置为 ``both`` 时,则同时打印Tensor的前向信息以及梯度信息。
返回:输出Tensor
返回:输出Tensor
返回类型:Variable
返回类型:Variable
.. note::
.. note::
输入和输出是两个不同的
变量,在接下来的过程中,你应该使用输出变量而非输入变量
,否则打印层将失去backward的信息。
输入和输出是两个不同的
Variable,在接下来的过程中,应该使用输出Variable而非输入Variable
,否则打印层将失去backward的信息。
**代码示例**:
**代码示例**:
...
@@ -38,7 +38,8 @@ Print
...
@@ -38,7 +38,8 @@ Print
import numpy as np
import numpy as np
x = fluid.layers.data(name='x', shape=[1], dtype='float32', lod_level=1)
x = fluid.layers.data(name='x', shape=[1], dtype='float32', lod_level=1)
x = fluid.layers.Print(x, message="The content of input layer:")
# 注意输出是使用Print的output
x = fluid.layers.Print(x, message="The content of input layer:")
y = fluid.layers.data(name='y', shape=[1], dtype='float32', lod_level=2)
y = fluid.layers.data(name='y', shape=[1], dtype='float32', lod_level=2)
out = fluid.layers.sequence_expand(x=x, y=y, ref_level=0)
out = fluid.layers.sequence_expand(x=x, y=y, ref_level=0)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录