Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
2e783663
P
Paddle
项目概览
Crayon鑫
/
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看板
提交
2e783663
编写于
10月 24, 2017
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable to output LoD in fetch_op and check output LoD in the op unit test.
上级
fa72e544
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
5 deletion
+21
-5
paddle/operators/fetch_op.cc
paddle/operators/fetch_op.cc
+1
-0
python/paddle/v2/framework/tests/op_test.py
python/paddle/v2/framework/tests/op_test.py
+15
-4
python/paddle/v2/framework/tests/test_lstm_op.py
python/paddle/v2/framework/tests/test_lstm_op.py
+5
-1
未找到文件。
paddle/operators/fetch_op.cc
浏览文件 @
2e783663
...
...
@@ -52,6 +52,7 @@ class FetchOp : public framework::OperatorBase {
// FIXME(yuyang18): Should we assume the fetch operator always generate
// CPU outputs?
dst_item
.
CopyFrom
(
src_item
,
platform
::
CPUPlace
(),
dev_ctx
);
dst_item
.
set_lod
(
src_item
.
lod
());
VLOG
(
3
)
<<
"Fetch variable "
<<
fetch_var_name
<<
" to "
<<
out_name
;
}
...
...
python/paddle/v2/framework/tests/op_test.py
浏览文件 @
2e783663
...
...
@@ -333,20 +333,31 @@ class OpTest(unittest.TestCase):
type
(
sub_out
))
for
sub_out_name
,
expect
in
sub_out
:
idx
=
find_actual
(
sub_out_name
,
fetch_list
)
actual
=
outs
[
idx
]
actual_t
=
np
.
array
(
outs
[
idx
])
expect_t
=
expect
[
0
]
\
if
isinstance
(
expect
,
tuple
)
else
expect
self
.
assertTrue
(
np
.
allclose
(
actual
,
expec
t
,
atol
=
atol
),
actual
_t
,
expect_
t
,
atol
=
atol
),
"Output ("
+
sub_out_name
+
") has diff at "
+
str
(
place
))
if
isinstance
(
expect
,
tuple
):
self
.
assertListEqual
(
actual_t
.
lod
(),
expect
[
1
],
"Output ("
+
sub_out_name
+
") has different lod at "
+
str
(
place
))
else
:
idx
=
find_actual
(
out_name
,
fetch_list
)
actual
=
outs
[
idx
]
actual
_t
=
outs
[
idx
]
expect
=
self
.
outputs
[
out_name
]
expect_t
=
expect
[
0
]
if
isinstance
(
expect
,
tuple
)
else
expect
self
.
assertTrue
(
np
.
allclose
(
actual
,
expec
t
,
atol
=
atol
),
actual
_t
,
expect_
t
,
atol
=
atol
),
"Output ("
+
out_name
+
") has diff at "
+
str
(
place
))
if
isinstance
(
expect
,
tuple
):
self
.
assertListEqual
(
actual_t
.
lod
(),
expect
[
1
],
"Output ("
+
out_name
+
") has different lod at "
+
str
(
place
))
def
check_output
(
self
,
atol
=
1e-5
):
places
=
[
core
.
CPUPlace
()]
...
...
python/paddle/v2/framework/tests/test_lstm_op.py
浏览文件 @
2e783663
...
...
@@ -155,7 +155,11 @@ class TestLstmOp(OpTest):
'Weight'
:
w
,
'Bias'
:
b
}
self
.
outputs
=
{
'Hidden'
:
h
,
'Cell'
:
c
,
'BatchGate'
:
g_sort
}
self
.
outputs
=
{
'Hidden'
:
(
h
,
self
.
lod
),
'Cell'
:
(
c
,
self
.
lod
),
'BatchGate'
:
g_sort
}
self
.
attrs
=
{
'usePeepholes'
:
True
,
'isReverse'
:
self
.
is_reverse
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录