Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
0a44bd48
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看板
提交
0a44bd48
编写于
6月 27, 2019
作者:
S
shixiaowei02
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'shixiaowei02/calib' into 'incubate/lite'
test of conv See merge request inference/paddlelite!77
上级
0731af04
9fa47bf7
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
19 addition
and
6 deletion
+19
-6
paddle/fluid/lite/kernels/arm/conv_compute_test.cc
paddle/fluid/lite/kernels/arm/conv_compute_test.cc
+19
-6
未找到文件。
paddle/fluid/lite/kernels/arm/conv_compute_test.cc
浏览文件 @
0a44bd48
...
@@ -280,6 +280,8 @@ TEST(conv_arm_int8, int8_fp32) {
...
@@ -280,6 +280,8 @@ TEST(conv_arm_int8, int8_fp32) {
group
=
oc
=
ic
;
group
=
oc
=
ic
;
}
}
LOG
(
INFO
)
<<
"flag_bias: "
<<
flag_bias
;
const
int
dks
=
dilation
*
(
ks
-
1
)
+
1
;
const
int
dks
=
dilation
*
(
ks
-
1
)
+
1
;
int
oh
=
(
ih
+
2
*
padding
-
dks
)
/
stride
+
1
;
int
oh
=
(
ih
+
2
*
padding
-
dks
)
/
stride
+
1
;
int
ow
=
(
iw
+
2
*
padding
-
dks
)
/
stride
+
1
;
int
ow
=
(
iw
+
2
*
padding
-
dks
)
/
stride
+
1
;
...
@@ -291,7 +293,7 @@ TEST(conv_arm_int8, int8_fp32) {
...
@@ -291,7 +293,7 @@ TEST(conv_arm_int8, int8_fp32) {
Tensor
input_fp32
,
input_int8
;
Tensor
input_fp32
,
input_int8
;
Tensor
filter_fp32
,
filter_int8
;
Tensor
filter_fp32
,
filter_int8
;
Tensor
bias_fp32
,
bias_int
8
;
Tensor
bias_fp32
,
bias_int
32
;
Tensor
output_int32_ref
,
output_int32
;
Tensor
output_int32_ref
,
output_int32
;
Tensor
output_fp32_ref
,
output_fp32
;
Tensor
output_fp32_ref
,
output_fp32
;
Tensor
output_int8_ref
,
output_int8
;
Tensor
output_int8_ref
,
output_int8
;
...
@@ -301,7 +303,7 @@ TEST(conv_arm_int8, int8_fp32) {
...
@@ -301,7 +303,7 @@ TEST(conv_arm_int8, int8_fp32) {
filter_fp32
.
Resize
(
filter_shape
);
filter_fp32
.
Resize
(
filter_shape
);
filter_int8
.
Resize
(
filter_shape
);
filter_int8
.
Resize
(
filter_shape
);
bias_fp32
.
Resize
(
bias_shape
);
bias_fp32
.
Resize
(
bias_shape
);
bias_int
8
.
Resize
(
bias_shape
);
bias_int
32
.
Resize
(
bias_shape
);
output_int32
.
Resize
(
output_shape
);
output_int32
.
Resize
(
output_shape
);
output_int32_ref
.
Resize
(
output_shape
);
output_int32_ref
.
Resize
(
output_shape
);
output_fp32_ref
.
Resize
(
output_shape
);
output_fp32_ref
.
Resize
(
output_shape
);
...
@@ -321,8 +323,7 @@ TEST(conv_arm_int8, int8_fp32) {
...
@@ -321,8 +323,7 @@ TEST(conv_arm_int8, int8_fp32) {
float
*
bias_fp32_data
=
float
*
bias_fp32_data
=
bias_fp32
.
mutable_data
<
float
>
();
bias_fp32
.
mutable_data
<
float
>
();
int8_t
*
bias_int8_data
=
int
*
bias_int32_data
=
bias_int32
.
mutable_data
<
int
>
();
bias_int8
.
mutable_data
<
int8_t
>
();
for
(
int
i
=
0
;
i
<
input_fp32
.
dims
().
production
();
for
(
int
i
=
0
;
i
<
input_fp32
.
dims
().
production
();
i
++
)
{
i
++
)
{
...
@@ -354,10 +355,21 @@ TEST(conv_arm_int8, int8_fp32) {
...
@@ -354,10 +355,21 @@ TEST(conv_arm_int8, int8_fp32) {
filter_fp32_data
,
filter_int8_data
,
filter_fp32_data
,
filter_int8_data
,
w_scale
.
data
(),
axis_size
,
1
,
inner_size
);
w_scale
.
data
(),
axis_size
,
1
,
inner_size
);
// lite::arm::math::trans_fp32_bias_to_int32_basic(&bias_fp32,
// &bias_int32, in_scale[0], w_scale);
for
(
int
i
=
0
;
i
<
bias_int32
.
dims
().
production
();
i
++
)
{
bias_int32_data
[
i
]
=
1
;
}
operators
::
ConvParam
param
;
operators
::
ConvParam
param
;
param
.
x
=
&
input_int8
;
param
.
x
=
&
input_int8
;
param
.
filter
=
&
filter_int8
;
param
.
filter
=
&
filter_int8
;
param
.
bias
=
&
bias_int8
;
if
(
flag_bias
)
{
param
.
bias
=
&
bias_int32
;
}
else
{
param
.
bias
=
nullptr
;
}
param
.
fuse_relu
=
false
;
param
.
fuse_relu
=
false
;
param
.
paddings
=
std
::
vector
<
int
>
({
padding
,
padding
});
param
.
paddings
=
std
::
vector
<
int
>
({
padding
,
padding
});
param
.
strides
=
std
::
vector
<
int
>
({
stride
,
stride
});
param
.
strides
=
std
::
vector
<
int
>
({
stride
,
stride
});
...
@@ -371,6 +383,7 @@ TEST(conv_arm_int8, int8_fp32) {
...
@@ -371,6 +383,7 @@ TEST(conv_arm_int8, int8_fp32) {
output_int32_ref
.
mutable_data
<
int
>
();
output_int32_ref
.
mutable_data
<
int
>
();
// ============ int8gemm_int32 ============
// ============ int8gemm_int32 ============
/*
param.output = &output_int32;
param.output = &output_int32;
std::unique_ptr<KernelContext> ctx_int32(
std::unique_ptr<KernelContext> ctx_int32(
new KernelContext);
new KernelContext);
...
@@ -388,7 +401,7 @@ TEST(conv_arm_int8, int8_fp32) {
...
@@ -388,7 +401,7 @@ TEST(conv_arm_int8, int8_fp32) {
EXPECT_NEAR(output_int32_data[i],
EXPECT_NEAR(output_int32_data[i],
output_int32_ref_data[i], 1e-3);
output_int32_ref_data[i], 1e-3);
}
}
*/
// ============ int8gemm_int8 ============
// ============ int8gemm_int8 ============
int8_t
*
output_int8_ref_data
=
int8_t
*
output_int8_ref_data
=
output_int8_ref
.
mutable_data
<
int8_t
>
();
output_int8_ref
.
mutable_data
<
int8_t
>
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录