Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
e23c5efd
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看板
提交
e23c5efd
编写于
6月 28, 2019
作者:
N
nhzlx
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'incubate/lite' of
http://10.87.145.36/inference/paddlelite
into xzl/incubate/lite
上级
5c9894d3
c998292e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
20 addition
and
7 deletion
+20
-7
paddle/fluid/lite/api/android/jni/src/com/baidu/paddle/lite/PaddlePredictor.java
...ndroid/jni/src/com/baidu/paddle/lite/PaddlePredictor.java
+1
-1
paddle/fluid/lite/kernels/arm/conv_compute_test.cc
paddle/fluid/lite/kernels/arm/conv_compute_test.cc
+19
-6
未找到文件。
paddle/fluid/lite/api/android/jni/src/com/baidu/paddle/lite/PaddlePredictor.java
浏览文件 @
e23c5efd
...
...
@@ -33,7 +33,7 @@ public class PaddlePredictor {
*
* @param modelPath modelPath model file path
* @param preferredPlace preferred place to run Cxx Model
* @param validPlaces
n * 4 int array,
valid places to run Cxx Model
* @param validPlaces valid places to run Cxx Model
* @return true if load successfully
*/
public
static
native
boolean
loadCxxModel
(
String
modelPath
,
Place
preferredPlace
,
Place
[]
validPlaces
);
...
...
paddle/fluid/lite/kernels/arm/conv_compute_test.cc
浏览文件 @
e23c5efd
...
...
@@ -280,6 +280,8 @@ TEST(conv_arm_int8, int8_fp32) {
group
=
oc
=
ic
;
}
LOG
(
INFO
)
<<
"flag_bias: "
<<
flag_bias
;
const
int
dks
=
dilation
*
(
ks
-
1
)
+
1
;
int
oh
=
(
ih
+
2
*
padding
-
dks
)
/
stride
+
1
;
int
ow
=
(
iw
+
2
*
padding
-
dks
)
/
stride
+
1
;
...
...
@@ -291,7 +293,7 @@ TEST(conv_arm_int8, int8_fp32) {
Tensor
input_fp32
,
input_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_fp32_ref
,
output_fp32
;
Tensor
output_int8_ref
,
output_int8
;
...
...
@@ -301,7 +303,7 @@ TEST(conv_arm_int8, int8_fp32) {
filter_fp32
.
Resize
(
filter_shape
);
filter_int8
.
Resize
(
filter_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_ref
.
Resize
(
output_shape
);
output_fp32_ref
.
Resize
(
output_shape
);
...
...
@@ -321,8 +323,7 @@ TEST(conv_arm_int8, int8_fp32) {
float
*
bias_fp32_data
=
bias_fp32
.
mutable_data
<
float
>
();
int8_t
*
bias_int8_data
=
bias_int8
.
mutable_data
<
int8_t
>
();
int
*
bias_int32_data
=
bias_int32
.
mutable_data
<
int
>
();
for
(
int
i
=
0
;
i
<
input_fp32
.
dims
().
production
();
i
++
)
{
...
...
@@ -354,10 +355,21 @@ TEST(conv_arm_int8, int8_fp32) {
filter_fp32_data
,
filter_int8_data
,
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
;
param
.
x
=
&
input_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
.
paddings
=
std
::
vector
<
int
>
({
padding
,
padding
});
param
.
strides
=
std
::
vector
<
int
>
({
stride
,
stride
});
...
...
@@ -371,6 +383,7 @@ TEST(conv_arm_int8, int8_fp32) {
output_int32_ref
.
mutable_data
<
int
>
();
// ============ int8gemm_int32 ============
/*
param.output = &output_int32;
std::unique_ptr<KernelContext> ctx_int32(
new KernelContext);
...
...
@@ -388,7 +401,7 @@ TEST(conv_arm_int8, int8_fp32) {
EXPECT_NEAR(output_int32_data[i],
output_int32_ref_data[i], 1e-3);
}
*/
// ============ int8gemm_int8 ============
int8_t
*
output_int8_ref_data
=
output_int8_ref
.
mutable_data
<
int8_t
>
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录