Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
9513ad79
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
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看板
提交
9513ad79
编写于
1月 06, 2019
作者:
H
hjchen2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix 3x3 depthwise conv bug when if_bias is false
上级
bb42168c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
7 deletion
+15
-7
src/io/paddle_mobile.cpp
src/io/paddle_mobile.cpp
+1
-0
src/operators/math/depthwise_conv3x3.cpp
src/operators/math/depthwise_conv3x3.cpp
+11
-4
src/operators/math/depthwise_conv5x5_int8.cpp
src/operators/math/depthwise_conv5x5_int8.cpp
+2
-2
tools/pre-commit.hooks/cpplint.hook
tools/pre-commit.hooks/cpplint.hook
+1
-1
未找到文件。
src/io/paddle_mobile.cpp
浏览文件 @
9513ad79
...
...
@@ -91,6 +91,7 @@ PMStatus PaddleMobile<Device, T>::Load(const PaddleMobileConfig &config) {
}
}
template
<
typename
Device
,
typename
T
>
bool
PaddleMobile
<
Device
,
T
>::
LoadCombinedMemory
(
size_t
model_len
,
const
uint8_t
*
model_buf
,
size_t
combined_params_len
,
uint8_t
*
combined_params_buf
,
bool
optimize
,
bool
quantification
,
...
...
src/operators/math/depthwise_conv3x3.cpp
浏览文件 @
9513ad79
...
...
@@ -253,7 +253,6 @@ void DepthwiseConv3x3s1p1(const framework::Tensor *input,
framework
::
Tensor
*
output
,
framework
::
Tensor
*
bias
,
bool
if_bias
,
bool
if_relu
)
{
#if __ARM_NEON
const
float
*
bias_data
=
bias
->
data
<
float
>
();
const
int
batch_size
=
static_cast
<
int
>
(
input
->
dims
()[
0
]);
const
int
c
=
static_cast
<
int
>
(
input
->
dims
()[
1
]);
const
int
h
=
static_cast
<
int
>
(
input
->
dims
()[
2
]);
...
...
@@ -267,6 +266,11 @@ void DepthwiseConv3x3s1p1(const framework::Tensor *input,
const
int
lb
=
(
h
-
1
)
*
w
;
const
int
rb
=
h
*
w
-
1
;
const
float
*
bias_data
;
if
(
if_bias
)
{
bias_data
=
bias
->
data
<
float
>
();
}
float32x4_t
zero
=
vdupq_n_f32
(
0.0
);
for
(
int
b
=
0
;
b
<
batch_size
;
++
b
)
{
...
...
@@ -1966,7 +1970,6 @@ void DepthwiseConv3x3s2p0(const framework::Tensor *input,
framework
::
Tensor
*
output
,
framework
::
Tensor
*
bias
,
bool
if_bias
,
bool
if_relu
)
{
#if __ARM_NEON
const
int
batch_size
=
static_cast
<
int
>
(
input
->
dims
()[
0
]);
const
int
input_channel
=
static_cast
<
int
>
(
input
->
dims
()[
1
]);
...
...
@@ -1983,7 +1986,12 @@ void DepthwiseConv3x3s2p0(const framework::Tensor *input,
for
(
int
c
=
0
;
c
<
input_channel
;
c
++
)
{
const
float
*
filter_data
=
filter
->
data
<
float
>
()
+
c
*
9
;
const
float
*
input_data
=
input
->
data
<
float
>
()
+
c
*
inhxw
;
const
float
*
bias_data
=
bias
->
data
<
float
>
()
+
c
;
const
float
*
bias_data
;
float32x4_t
biasv
;
if
(
if_bias
)
{
bias_data
=
bias
->
data
<
float
>
()
+
c
;
biasv
=
vld1q_dup_f32
(
bias_data
);
}
float
*
output_data
=
output
->
data
<
float
>
()
+
c
*
outhxw
;
float
w00
=
filter_data
[
0
];
float
w01
=
filter_data
[
1
];
...
...
@@ -1994,7 +2002,6 @@ void DepthwiseConv3x3s2p0(const framework::Tensor *input,
float
w20
=
filter_data
[
6
];
float
w21
=
filter_data
[
7
];
float
w22
=
filter_data
[
8
];
float32x4_t
biasv
=
vld1q_dup_f32
(
bias_data
);
for
(
int
i
=
0
;
i
<
output_height
;
i
+=
1
)
{
for
(
int
m
=
0
;
m
<
output_width
-
2
;
m
+=
3
)
{
float
*
output_ptr
=
output_data
+
i
*
output_width
+
m
;
...
...
src/operators/math/depthwise_conv5x5_int8.cpp
浏览文件 @
9513ad79
...
...
@@ -643,8 +643,8 @@ void DepthwiseConv5x5S1<int8_t, int32_t>(const framework::Tensor &input,
for
(
int
w
=
valid_w_end
;
w
<
output_w
;
++
w
)
{
int
padding
=
w
+
5
-
(
padding_w
+
input_w
);
if
(
padding
>=
5
)
{
*
output_ptr0
=
0
.
f
;
*
output_ptr1
=
0
.
f
;
*
output_ptr0
=
0
;
*
output_ptr1
=
0
;
}
else
{
int
iw
=
w
-
valid_w_end
;
int32_t
sum0
=
input_ptr0
[
iw
]
*
filter_ptr0
[
0
]
+
...
...
tools/pre-commit.hooks/cpplint.hook
浏览文件 @
9513ad79
...
...
@@ -5,7 +5,7 @@ TOTAL_ERRORS=0
# The trick to remove deleted files: https://stackoverflow.com/a/2413151
for
file
in
$(
git diff
--cached
--name-status
|
awk
'$1 != "D" {print $2}'
|
\
grep
-v
".pb.cpp"
|
grep
-v
".pb.h"
|
grep
-v
".pb-c.h"
|
grep
-v
".pb-c.c"
|
\
grep
-v
"protobuf-c.h"
|
grep
-v
"protobuf-c.c"
|
grep
-v
"PaddleMobileCPU.h"
)
;
do
grep
-v
"protobuf-c.h"
|
grep
-v
"protobuf-c.c"
)
;
do
cpplint
$file
;
TOTAL_ERRORS
=
$(
expr
$TOTAL_ERRORS
+
$?
)
;
done
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录