Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
urhero
Paddle
提交
6cccab92
P
Paddle
项目概览
urhero
/
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,发现更多精彩内容 >>
未验证
提交
6cccab92
编写于
7月 30, 2019
作者:
W
whs
提交者:
GitHub
7月 30, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make lod_append support variable lod. (#18908)
test=develop
上级
cfcb96d2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
9 deletion
+14
-9
paddle/fluid/API.spec
paddle/fluid/API.spec
+1
-1
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+13
-8
未找到文件。
paddle/fluid/API.spec
浏览文件 @
6cccab92
...
...
@@ -164,7 +164,7 @@ paddle.fluid.layers.reshape (ArgSpec(args=['x', 'shape', 'actual_shape', 'act',
paddle.fluid.layers.squeeze (ArgSpec(args=['input', 'axes', 'name'], varargs=None, keywords=None, defaults=(None,)), ('document', 'ebbac07662a6e22e8e299ced880c7775'))
paddle.fluid.layers.unsqueeze (ArgSpec(args=['input', 'axes', 'name'], varargs=None, keywords=None, defaults=(None,)), ('document', 'b9bd3129d36a70e7c4385df51ff71c62'))
paddle.fluid.layers.lod_reset (ArgSpec(args=['x', 'y', 'target_lod'], varargs=None, keywords=None, defaults=(None, None)), ('document', '74498d37dd622ac472cb36887fce09ea'))
paddle.fluid.layers.lod_append (ArgSpec(args=['x', 'level'], varargs=None, keywords=None, defaults=None), ('document', '
527cc61c20a8fa83008115440419f92b
'))
paddle.fluid.layers.lod_append (ArgSpec(args=['x', 'level'], varargs=None, keywords=None, defaults=None), ('document', '
37663c7c179e920838a250ea0e28d909
'))
paddle.fluid.layers.lrn (ArgSpec(args=['input', 'n', 'k', 'alpha', 'beta', 'name'], varargs=None, keywords=None, defaults=(5, 1.0, 0.0001, 0.75, None)), ('document', '73d297256da8954617996958d26ee93d'))
paddle.fluid.layers.pad (ArgSpec(args=['x', 'paddings', 'pad_value', 'name'], varargs=None, keywords=None, defaults=(0.0, None)), ('document', '2f189f8ef61f1c23779e1593b78755c0'))
paddle.fluid.layers.pad_constant_like (ArgSpec(args=['x', 'y', 'pad_value', 'name'], varargs=None, keywords=None, defaults=(0.0, None)), ('document', '95aa1972983f30fe9b5a3713e523e20f'))
...
...
python/paddle/fluid/layers/nn.py
浏览文件 @
6cccab92
...
...
@@ -7099,7 +7099,7 @@ def lod_append(x, level):
Args:
x (Variable): Input variable which could be a tensor or LoDTensor.
level (list|tuple): The LoD level to be appended into LoD of x.
level (list|tuple
|Variable
): The LoD level to be appended into LoD of x.
Returns:
Variable: Output variable with new LoD level.
...
...
@@ -7117,16 +7117,21 @@ def lod_append(x, level):
from
collections
import
Iterable
if
x
is
None
:
raise
ValueError
(
"Input(x) can't be None."
)
if
not
isinstance
(
level
,
Iterable
):
raise
ValueError
(
"Input(level) must be list or tuple."
)
if
(
not
isinstance
(
level
,
Iterable
))
and
(
not
isinstance
(
level
,
Variable
)):
raise
ValueError
(
"Input(level) must be list, tuple or Variable."
)
helper
=
LayerHelper
(
"lod_append"
,
**
locals
())
out
=
helper
.
create_variable_for_type_inference
(
dtype
=
x
.
dtype
)
inputs
=
{
'X'
:
x
}
attrs
=
{
'append'
:
True
}
if
isinstance
(
level
,
Variable
):
inputs
[
'Y'
]
=
level
else
:
attrs
[
'target_lod'
]
=
level
helper
.
append_op
(
type
=
"lod_reset"
,
inputs
=
{
'X'
:
x
},
attrs
=
{
'target_lod'
:
level
,
'append'
:
True
},
outputs
=
{
'Out'
:
out
})
type
=
"lod_reset"
,
inputs
=
inputs
,
attrs
=
attrs
,
outputs
=
{
'Out'
:
out
})
return
out
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录