Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
de212ae2
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
de212ae2
编写于
3月 11, 2019
作者:
M
minqiyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish code
test=develop
上级
d17bb4e6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
20 deletion
+30
-20
python/paddle/fluid/imperative/nn.py
python/paddle/fluid/imperative/nn.py
+1
-0
python/paddle/fluid/tests/unittests/op_test.py
python/paddle/fluid/tests/unittests/op_test.py
+29
-20
未找到文件。
python/paddle/fluid/imperative/nn.py
浏览文件 @
de212ae2
...
@@ -516,6 +516,7 @@ class GRUUnit(layers.Layer):
...
@@ -516,6 +516,7 @@ class GRUUnit(layers.Layer):
Args:
Args:
input (Variable): The fc transformed input value of current step.
input (Variable): The fc transformed input value of current step.
name_scope (str): See base class.
hidden (Variable): The hidden value of gru unit from previous step.
hidden (Variable): The hidden value of gru unit from previous step.
size (integer): The input dimension value.
size (integer): The input dimension value.
param_attr(ParamAttr|None): The parameter attribute for the learnable
param_attr(ParamAttr|None): The parameter attribute for the learnable
...
...
python/paddle/fluid/tests/unittests/op_test.py
浏览文件 @
de212ae2
...
@@ -407,19 +407,26 @@ class OpTest(unittest.TestCase):
...
@@ -407,19 +407,26 @@ class OpTest(unittest.TestCase):
actual_t
,
expect_t
,
atol
=
atol
,
equal_nan
=
equal_nan
),
actual_t
,
expect_t
,
atol
=
atol
,
equal_nan
=
equal_nan
),
"Output ("
+
sub_out_name
+
") has diff at "
+
"Output ("
+
sub_out_name
+
") has diff at "
+
str
(
place
))
str
(
place
))
self
.
assertTrue
(
if
check_imperative
:
np
.
allclose
(
self
.
assertTrue
(
imperative_actual_t
,
np
.
allclose
(
expect_t
,
imperative_actual_t
,
atol
=
atol
,
expect_t
,
equal_nan
=
equal_nan
),
atol
=
atol
,
"Output ("
+
sub_out_name
+
") has diff at "
+
equal_nan
=
equal_nan
),
str
(
place
)
+
" in imperative mode"
)
"Output ("
+
sub_out_name
+
") has diff at "
+
str
(
place
)
+
" in imperative mode"
)
if
isinstance
(
expect
,
tuple
):
if
isinstance
(
expect
,
tuple
):
self
.
assertListEqual
(
self
.
assertListEqual
(
actual
.
recursive_sequence_lengths
(),
expect
[
1
],
actual
.
recursive_sequence_lengths
(),
expect
[
1
],
"Output ("
+
sub_out_name
+
"Output ("
+
sub_out_name
+
") has different lod at "
+
str
(
place
))
") has different lod at "
+
str
(
place
))
if
check_imperative
:
self
.
assertListEqual
(
imperative_actual
.
_ivar
.
value
().
get_tensor
()
.
recursive_sequence_lengths
(),
expect
[
1
],
"Output ("
+
out_name
+
") has different lod at "
+
str
(
place
)
+
" in imperative mode"
)
else
:
else
:
if
check_imperative
:
if
check_imperative
:
imperative_actual
=
imperative_outs
[
out_name
][
0
]
imperative_actual
=
imperative_outs
[
out_name
][
0
]
...
@@ -436,16 +443,17 @@ class OpTest(unittest.TestCase):
...
@@ -436,16 +443,17 @@ class OpTest(unittest.TestCase):
"Output ("
+
out_name
+
") has diff at "
+
str
(
place
)
+
"Output ("
+
out_name
+
") has diff at "
+
str
(
place
)
+
"
\n
Expect "
+
str
(
expect_t
)
+
"
\n
"
+
"But Got"
+
"
\n
Expect "
+
str
(
expect_t
)
+
"
\n
"
+
"But Got"
+
str
(
actual_t
)
+
" in class "
+
self
.
__class__
.
__name__
)
str
(
actual_t
)
+
" in class "
+
self
.
__class__
.
__name__
)
self
.
assertTrue
(
if
check_imperative
:
np
.
allclose
(
self
.
assertTrue
(
imperative_actual_t
,
np
.
allclose
(
expect_t
,
imperative_actual_t
,
atol
=
atol
,
expect_t
,
equal_nan
=
equal_nan
),
atol
=
atol
,
"Output ("
+
out_name
+
") has diff at "
+
str
(
place
)
+
equal_nan
=
equal_nan
),
"
\n
Expect "
+
str
(
expect_t
)
+
"
\n
"
+
"But Got"
+
"Output ("
+
out_name
+
") has diff at "
+
str
(
place
)
+
str
(
imperative_actual_t
)
+
" in class "
+
"
\n
Expect "
+
str
(
expect_t
)
+
"
\n
"
+
"But Got"
+
self
.
__class__
.
__name__
)
str
(
imperative_actual_t
)
+
" in class "
+
self
.
__class__
.
__name__
)
if
isinstance
(
expect
,
tuple
):
if
isinstance
(
expect
,
tuple
):
self
.
assertListEqual
(
actual
.
recursive_sequence_lengths
(),
self
.
assertListEqual
(
actual
.
recursive_sequence_lengths
(),
expect
[
1
],
"Output ("
+
out_name
+
expect
[
1
],
"Output ("
+
out_name
+
...
@@ -453,8 +461,9 @@ class OpTest(unittest.TestCase):
...
@@ -453,8 +461,9 @@ class OpTest(unittest.TestCase):
if
check_imperative
:
if
check_imperative
:
self
.
assertListEqual
(
self
.
assertListEqual
(
imperative_actual
.
_ivar
.
value
().
get_tensor
()
imperative_actual
.
_ivar
.
value
().
get_tensor
()
.
recursive_sequence_lengths
(),
expect
[
1
],
"Output ("
.
recursive_sequence_lengths
(),
expect
[
1
],
+
out_name
+
") has different lod at "
+
str
(
place
))
"Output ("
+
out_name
+
") has different lod at "
+
str
(
place
)
+
" in imperative mode"
)
def
_get_places
(
self
):
def
_get_places
(
self
):
if
self
.
dtype
==
np
.
float16
:
if
self
.
dtype
==
np
.
float16
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录