Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
c33664c8
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看板
提交
c33664c8
编写于
9月 27, 2020
作者:
J
jiweibo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix unit test.
上级
6b727e08
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
22 deletion
+17
-22
paddle/fluid/inference/tests/api/lite_resnet50_test.cc
paddle/fluid/inference/tests/api/lite_resnet50_test.cc
+17
-22
未找到文件。
paddle/fluid/inference/tests/api/lite_resnet50_test.cc
浏览文件 @
c33664c8
...
@@ -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,14 @@ TEST(AnalysisPredictor, use_gpu) {
...
@@ -49,17 +50,14 @@ 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
,
738.165
,
1013.22
,
-
438.17
,
366.401
,
927.659
,
736.222
,
927.66187
f
,
736.2241
f
,
-
633.68567
f
,
-
329.92737
f
,
-
430.15637
f
,
-
633.684
,
-
329.927
,
-
430.155
,
-
633.062
,
-
146.548
,
-
1324.28
,
-
1349.36
,
-
633.0639
f
,
-
146.54858
f
,
-
1324.2804
f
,
-
1349.3661
f
,
-
242.67671
f
,
-
242.675
,
117.448
,
-
801.723
,
-
391.514
,
-
404.818
,
454.16
,
515.48
,
117.44864
f
,
-
801.7251
f
,
-
391.51495
f
,
-
404.8202
f
,
454.16132
f
,
-
133.031
,
69.293
,
590.096
,
-
1434.69
,
-
1070.89
,
307.074
,
400.525
,
515.48206
f
,
-
133.03114
f
,
69.293076
f
,
590.09753
f
,
-
1434.6917
f
,
-
316.12
,
-
587.125
,
-
161.056
,
800.363
,
-
96.4708
,
748.706
,
868.174
,
-
1070.8903
f
,
307.0744
f
,
400.52573
f
,
-
316.12177
f
,
-
587.1265
f
,
-
447.938
,
112.737
,
1127.2
,
47.4355
,
677.72
,
593.186
,
-
336.4
,
-
161.05742
f
,
800.3663
f
,
-
96.47157
f
,
748.708
f
,
868.17645
f
,
551.362
,
397.823
,
78.3979
,
-
715.398
,
405.969
,
404.256
,
246.019
,
-
447.9403
f
,
112.73656
f
,
1127.1992
f
,
47.43518
f
,
677.7219
f
,
-
8.42969
,
131.365
,
-
648.051
};
593.1881
f
,
-
336.4011
f
,
551.3634
f
,
397.82474
f
,
78.39835
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 +106,14 @@ TEST(Predictor, use_gpu) {
...
@@ -108,17 +106,14 @@ 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
,
738.165
,
1013.22
,
-
438.17
,
366.401
,
927.659
,
736.222
,
927.66187
f
,
736.2241
f
,
-
633.68567
f
,
-
329.92737
f
,
-
430.15637
f
,
-
633.684
,
-
329.927
,
-
430.155
,
-
633.062
,
-
146.548
,
-
1324.28
,
-
1349.36
,
-
633.0639
f
,
-
146.54858
f
,
-
1324.2804
f
,
-
1349.3661
f
,
-
242.67671
f
,
-
242.675
,
117.448
,
-
801.723
,
-
391.514
,
-
404.818
,
454.16
,
515.48
,
117.44864
f
,
-
801.7251
f
,
-
391.51495
f
,
-
404.8202
f
,
454.16132
f
,
-
133.031
,
69.293
,
590.096
,
-
1434.69
,
-
1070.89
,
307.074
,
400.525
,
515.48206
f
,
-
133.03114
f
,
69.293076
f
,
590.09753
f
,
-
1434.6917
f
,
-
316.12
,
-
587.125
,
-
161.056
,
800.363
,
-
96.4708
,
748.706
,
868.174
,
-
1070.8903
f
,
307.0744
f
,
400.52573
f
,
-
316.12177
f
,
-
587.1265
f
,
-
447.938
,
112.737
,
1127.2
,
47.4355
,
677.72
,
593.186
,
-
336.4
,
-
161.05742
f
,
800.3663
f
,
-
96.47157
f
,
748.708
f
,
868.17645
f
,
551.362
,
397.823
,
78.3979
,
-
715.398
,
405.969
,
404.256
,
246.019
,
-
447.9403
f
,
112.73656
f
,
1127.1992
f
,
47.43518
f
,
677.7219
f
,
-
8.42969
,
131.365
,
-
648.051
};
593.1881
f
,
-
336.4011
f
,
551.3634
f
,
397.82474
f
,
78.39835
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录