Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
afeixing77
Paddle
提交
57bc564d
P
Paddle
项目概览
afeixing77
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
57bc564d
编写于
1月 02, 2018
作者:
Y
yangyaming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish doc for lod_rank_table.
上级
10cd6eb6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
11 deletion
+20
-11
python/paddle/v2/fluid/layers/control_flow.py
python/paddle/v2/fluid/layers/control_flow.py
+20
-11
未找到文件。
python/paddle/v2/fluid/layers/control_flow.py
浏览文件 @
57bc564d
...
@@ -397,25 +397,34 @@ class While(object):
...
@@ -397,25 +397,34 @@ class While(object):
def
lod_rank_table
(
x
,
level
=
0
):
def
lod_rank_table
(
x
,
level
=
0
):
"""LoD Rank Table Operator. Given an input variable `x` and a LoD level,
"""LoD Rank Table Operator. Given an input variable **x** and a level number
this layer creates a LodRankTable object. A LoDRankTable object contains a
of LoD, this layer creates a LodRankTable object. A LoDRankTable object
list of bi-element tuples and each tuple consists of an index and a length.
contains a list of bi-element tuples. Each tuple consists of an index and
For given level's LoD information, the index is the sequence position and
a length, both of which are int type. Reffering to specified level of LoD,
the length representes the sequence length. Please note that the list is
the index is the sequence index number and the length representes the
ranked in descending order by the length. The following is an example:
sequence length. Please note that the list is ranked in descending order by
the length. The following is an example:
.. code-block:: text
.. code-block:: text
x is a LoDTensor:
x is a LoDTensor:
x.lod = [[0,
1,
2, 3],
x.lod = [[0,
2, 3],
[0, 5, 6, 7]]
[0, 5, 6, 7]]
x.data = [a, b, c, d, e, f, g]
x.data = [a, b, c, d, e, f, g]
Create lod rank table:
1. set level to 0:
lod_rank_table_obj = lod_rank_table(x, level=1)
Create lod rank table:
lod_rank_table_obj = lod_rank_table(x, level=0)
Get:
Get:
lod_rank_table_obj.items() = [(0, 5), (1, 1), (2, 1)]
lod_rank_table_obj.items() = [(0, 2), (1, 1)]
2. set level to 1:
Create lod rank table:
lod_rank_table_obj = lod_rank_table(x, level=1)
Get:
lod_rank_table_obj.items() = [(0, 5), (1, 1), (2, 1)]
Args:
Args:
x (Variable): Input variable, a LoDTensor based which to create the lod
x (Variable): Input variable, a LoDTensor based which to create the lod
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录