Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
2bc70ab2
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
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看板
未验证
提交
2bc70ab2
编写于
9月 28, 2020
作者:
W
Wilber
提交者:
GitHub
9月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix lite_resnet50 unit test. (#27611)
上级
07b01b0e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
22 deletion
+19
-22
paddle/fluid/inference/tests/api/lite_resnet50_test.cc
paddle/fluid/inference/tests/api/lite_resnet50_test.cc
+19
-22
未找到文件。
paddle/fluid/inference/tests/api/lite_resnet50_test.cc
浏览文件 @
2bc70ab2
...
@@ -15,6 +15,7 @@ limitations under the License. */
...
@@ -15,6 +15,7 @@ limitations under the License. */
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <cmath>
#include <cmath>
#include "paddle/fluid/inference/tests/api/tester_helper.h"
#include "paddle/fluid/inference/tests/api/tester_helper.h"
...
@@ -49,17 +50,15 @@ TEST(AnalysisPredictor, use_gpu) {
...
@@ -49,17 +50,15 @@ TEST(AnalysisPredictor, use_gpu) {
ASSERT_TRUE
(
predictor
->
Run
(
inputs
,
&
outputs
));
ASSERT_TRUE
(
predictor
->
Run
(
inputs
,
&
outputs
));
const
std
::
vector
<
float
>
truth_values
=
{
const
std
::
vector
<
float
>
truth_values
=
{
127.780396
f
,
738.16656
f
,
1013.2264
f
,
-
438.17206
f
,
366.4022
f
,
127.779
f
,
738.165
f
,
1013.22
f
,
-
438.17
f
,
366.401
f
,
927.659
f
,
927.66187
f
,
736.2241
f
,
-
633.68567
f
,
-
329.92737
f
,
-
430.15637
f
,
736.222
f
,
-
633.684
f
,
-
329.927
f
,
-
430.155
f
,
-
633.062
f
,
-
146.548
f
,
-
633.0639
f
,
-
146.54858
f
,
-
1324.2804
f
,
-
1349.3661
f
,
-
242.67671
f
,
-
1324.28
f
,
-
1349.36
f
,
-
242.675
f
,
117.448
f
,
-
801.723
f
,
-
391.514
f
,
117.44864
f
,
-
801.7251
f
,
-
391.51495
f
,
-
404.8202
f
,
454.16132
f
,
-
404.818
f
,
454.16
f
,
515.48
f
,
-
133.031
f
,
69.293
f
,
590.096
f
,
515.48206
f
,
-
133.03114
f
,
69.293076
f
,
590.09753
f
,
-
1434.6917
f
,
-
1434.69
f
,
-
1070.89
f
,
307.074
f
,
400.525
f
,
-
316.12
f
,
-
587.125
f
,
-
1070.8903
f
,
307.0744
f
,
400.52573
f
,
-
316.12177
f
,
-
587.1265
f
,
-
161.056
f
,
800.363
f
,
-
96.4708
f
,
748.706
f
,
868.174
f
,
-
447.938
f
,
-
161.05742
f
,
800.3663
f
,
-
96.47157
f
,
748.708
f
,
868.17645
f
,
112.737
f
,
1127.2
f
,
47.4355
f
,
677.72
f
,
593.186
f
,
-
336.4
f
,
-
447.9403
f
,
112.73656
f
,
1127.1992
f
,
47.43518
f
,
677.7219
f
,
551.362
f
,
397.823
f
,
78.3979
f
,
-
715.398
f
,
405.969
f
,
404.256
f
,
593.1881
f
,
-
336.4011
f
,
551.3634
f
,
397.82474
f
,
78.39835
f
,
246.019
f
,
-
8.42969
f
,
131.365
f
,
-
648.051
f
};
-
715.4006
f
,
405.96988
f
,
404.25684
f
,
246.01978
f
,
-
8.430191
f
,
131.36617
f
,
-
648.0528
f
};
const
size_t
expected_size
=
1
;
const
size_t
expected_size
=
1
;
EXPECT_EQ
(
outputs
.
size
(),
expected_size
);
EXPECT_EQ
(
outputs
.
size
(),
expected_size
);
...
@@ -108,17 +107,15 @@ TEST(Predictor, use_gpu) {
...
@@ -108,17 +107,15 @@ TEST(Predictor, use_gpu) {
output_t
->
CopyToCpu
(
out_data
.
data
());
output_t
->
CopyToCpu
(
out_data
.
data
());
const
std
::
vector
<
float
>
truth_values
=
{
const
std
::
vector
<
float
>
truth_values
=
{
127.780396
f
,
738.16656
f
,
1013.2264
f
,
-
438.17206
f
,
366.4022
f
,
127.779
f
,
738.165
f
,
1013.22
f
,
-
438.17
f
,
366.401
f
,
927.659
f
,
927.66187
f
,
736.2241
f
,
-
633.68567
f
,
-
329.92737
f
,
-
430.15637
f
,
736.222
f
,
-
633.684
f
,
-
329.927
f
,
-
430.155
f
,
-
633.062
f
,
-
146.548
f
,
-
633.0639
f
,
-
146.54858
f
,
-
1324.2804
f
,
-
1349.3661
f
,
-
242.67671
f
,
-
1324.28
f
,
-
1349.36
f
,
-
242.675
f
,
117.448
f
,
-
801.723
f
,
-
391.514
f
,
117.44864
f
,
-
801.7251
f
,
-
391.51495
f
,
-
404.8202
f
,
454.16132
f
,
-
404.818
f
,
454.16
f
,
515.48
f
,
-
133.031
f
,
69.293
f
,
590.096
f
,
515.48206
f
,
-
133.03114
f
,
69.293076
f
,
590.09753
f
,
-
1434.6917
f
,
-
1434.69
f
,
-
1070.89
f
,
307.074
f
,
400.525
f
,
-
316.12
f
,
-
587.125
f
,
-
1070.8903
f
,
307.0744
f
,
400.52573
f
,
-
316.12177
f
,
-
587.1265
f
,
-
161.056
f
,
800.363
f
,
-
96.4708
f
,
748.706
f
,
868.174
f
,
-
447.938
f
,
-
161.05742
f
,
800.3663
f
,
-
96.47157
f
,
748.708
f
,
868.17645
f
,
112.737
f
,
1127.2
f
,
47.4355
f
,
677.72
f
,
593.186
f
,
-
336.4
f
,
-
447.9403
f
,
112.73656
f
,
1127.1992
f
,
47.43518
f
,
677.7219
f
,
551.362
f
,
397.823
f
,
78.3979
f
,
-
715.398
f
,
405.969
f
,
404.256
f
,
593.1881
f
,
-
336.4011
f
,
551.3634
f
,
397.82474
f
,
78.39835
f
,
246.019
f
,
-
8.42969
f
,
131.365
f
,
-
648.051
f
};
-
715.4006
f
,
405.96988
f
,
404.25684
f
,
246.01978
f
,
-
8.430191
f
,
131.36617
f
,
-
648.0528
f
};
float
*
data_o
=
out_data
.
data
();
float
*
data_o
=
out_data
.
data
();
for
(
size_t
j
=
0
;
j
<
out_num
;
j
+=
10
)
{
for
(
size_t
j
=
0
;
j
<
out_num
;
j
+=
10
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录