Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
546a663c
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
332
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
546a663c
编写于
7月 15, 2020
作者:
M
mapingshuo
提交者:
GitHub
7月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test=develop (#3943)
上级
845e80d9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
3 deletion
+26
-3
lite/tests/kernels/sequence_conv_compute_test.cc
lite/tests/kernels/sequence_conv_compute_test.cc
+26
-3
未找到文件。
lite/tests/kernels/sequence_conv_compute_test.cc
浏览文件 @
546a663c
...
...
@@ -85,21 +85,31 @@ class SequenceConvComputeTester : public arena::TestCase {
auto
output_dims
=
output
->
dims
();
auto
output_data
=
output
->
mutable_data
<
float
>
();
std
::
vector
<
std
::
vector
<
float
>>
res
;
if
(
contextStart_
==
-
2
)
{
if
(
contextStart_
==
-
2
&&
lod_
.
size
()
==
1
&&
lod_
[
0
]
==
std
::
vector
<
uint64_t
>
({
0
,
4
}))
{
res
=
{{
-
0.08867277
f
,
-
0.17257819
f
,
-
0.2564836
f
},
{
0.194508
f
,
0.05720823
f
,
-
0.08009153
f
},
{
0.73512584
f
,
0.5749428
f
,
0.41475973
f
},
{
0.5635012
f
,
0.49485126
f
,
0.42620137
f
}};
}
else
if
(
contextStart_
==
-
1
)
{
}
else
if
(
contextStart_
==
-
1
&&
lod_
.
size
()
==
1
&&
lod_
[
0
]
==
std
::
vector
<
uint64_t
>
({
0
,
4
}))
{
res
=
{{
0.194508
f
,
0.05720823
f
,
-
0.08009153
f
},
{
0.73512584
f
,
0.5749428
f
,
0.41475973
f
},
{
0.5635012
f
,
0.49485126
f
,
0.42620137
f
},
{
0.2517162
f
,
0.23646072
f
,
0.22120519
f
}};
}
else
if
(
contextStart_
==
0
)
{
}
else
if
(
contextStart_
==
0
&&
lod_
.
size
()
==
1
&&
lod_
[
0
]
==
std
::
vector
<
uint64_t
>
({
0
,
4
}))
{
res
=
{{
0.73512584
f
,
0.5749428
f
,
0.41475973
f
},
{
0.5635012
f
,
0.49485126
f
,
0.42620137
f
},
{
0.2517162
f
,
0.23646072
f
,
0.22120519
f
},
{
0.02574372
f
,
0.03337148
f
,
0.04099924
f
}};
}
else
if
(
contextStart_
==
-
1
&&
lod_
.
size
()
==
1
&&
lod_
[
0
]
==
std
::
vector
<
uint64_t
>
({
0
,
2
,
4
}))
{
res
=
{{
0.194508
,
0.05720823
,
-
0.08009153
},
{
0.7093821
,
0.57208234
,
0.43478262
},
{
0.19450802
,
0.17925248
,
0.16399695
},
{
0.2517162
,
0.23646072
,
0.22120519
}};
}
else
{
fprintf
(
stderr
,
"not supported contextStart_
\n
"
);
exit
(
-
1
);
...
...
@@ -136,12 +146,25 @@ void TestNormalCase(Place place, float abs_error = 2e-5) {
}
}
void
TestBatchCase
(
Place
place
,
float
abs_error
=
2e-5
)
{
std
::
vector
<
std
::
vector
<
uint64_t
>>
lod
{{
0
,
2
,
4
}};
std
::
vector
<
int64_t
>
dims
{
4
,
5
};
std
::
vector
<
int
>
candidate_pad_idx
{
-
1
};
for
(
int
pad_idx
:
candidate_pad_idx
)
{
std
::
unique_ptr
<
arena
::
TestCase
>
tester
(
new
SequenceConvComputeTester
(
place
,
"def"
,
lod
,
DDim
(
dims
),
pad_idx
,
1
,
3
,
3
));
arena
::
Arena
arena
(
std
::
move
(
tester
),
place
,
abs_error
);
arena
.
TestPrecision
();
}
}
TEST
(
sequence_conv
,
precision
)
{
#ifdef LITE_WITH_ARM
float
abs_error
=
2e-5
;
Place
place
(
TARGET
(
kARM
));
TestNormalCase
(
place
,
abs_error
);
TestBatchCase
(
place
,
abs_error
);
#endif
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录