Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
c08fbb01
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看板
提交
c08fbb01
编写于
6月 12, 2020
作者:
C
chenjiaoAngel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix format. test=develop
上级
e3b509fb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
40 deletion
+40
-40
lite/kernels/arm/group_norm_compute.cc
lite/kernels/arm/group_norm_compute.cc
+34
-34
lite/operators/deformable_conv_op.cc
lite/operators/deformable_conv_op.cc
+1
-2
lite/operators/group_norm_op.cc
lite/operators/group_norm_op.cc
+5
-4
未找到文件。
lite/kernels/arm/group_norm_compute.cc
浏览文件 @
c08fbb01
...
...
@@ -75,10 +75,10 @@ void GroupNormCompute::Run() {
in_p
+=
16
;
}
for
(
int
i
=
0
;
i
<
remain
-
3
;
i
+=
4
)
{
float32x4_t
in0
=
vld1q_f32
(
in_p
);
sum1
=
vaddq_f32
(
sum1
,
in0
);
summ1
=
vmlaq_f32
(
summ1
,
in0
,
in0
);
in_p
+=
4
;
float32x4_t
in0
=
vld1q_f32
(
in_p
);
sum1
=
vaddq_f32
(
sum1
,
in0
);
summ1
=
vmlaq_f32
(
summ1
,
in0
,
in0
);
in_p
+=
4
;
}
float
sum
=
0.0
;
float
summ
=
0.0
;
...
...
@@ -87,9 +87,9 @@ void GroupNormCompute::Run() {
summ0
=
vaddq_f32
(
summ0
,
summ1
);
summ2
=
vaddq_f32
(
summ2
,
summ3
);
for
(
int
i
=
0
;
i
<
remain
%
4
;
i
++
)
{
sum
+=
*
in_p
;
summ
+=
(
*
in_p
)
*
(
*
in_p
);
in_p
++
;
sum
+=
*
in_p
;
summ
+=
(
*
in_p
)
*
(
*
in_p
);
in_p
++
;
}
sum0
=
vaddq_f32
(
sum0
,
sum2
);
summ0
=
vaddq_f32
(
summ0
,
summ2
);
...
...
@@ -125,37 +125,37 @@ void GroupNormCompute::Run() {
const
float32x4_t
vbias
=
vdupq_n_f32
(
bias_val
);
const
float32x4_t
vmean
=
vdupq_n_f32
(
mean_val
);
for
(
int
k
=
0
;
k
<
cnt
;
k
++
)
{
float32x4_t
in0
=
vld1q_f32
(
in_p
);
float32x4_t
in1
=
vld1q_f32
(
in_p
+
4
);
float32x4_t
in2
=
vld1q_f32
(
in_p
+
8
);
float32x4_t
in3
=
vld1q_f32
(
in_p
+
12
);
float32x4_t
submean0
=
vsubq_f32
(
in0
,
vmean
);
float32x4_t
submean1
=
vsubq_f32
(
in1
,
vmean
);
float32x4_t
submean2
=
vsubq_f32
(
in2
,
vmean
);
float32x4_t
submean3
=
vsubq_f32
(
in3
,
vmean
);
float32x4_t
out0
=
vmlaq_f32
(
vbias
,
submean0
,
vsstd
);
float32x4_t
out1
=
vmlaq_f32
(
vbias
,
submean1
,
vsstd
);
float32x4_t
out2
=
vmlaq_f32
(
vbias
,
submean2
,
vsstd
);
float32x4_t
out3
=
vmlaq_f32
(
vbias
,
submean3
,
vsstd
);
vst1q_f32
(
out_p
,
out0
);
vst1q_f32
(
out_p
+
4
,
out0
);
vst1q_f32
(
out_p
+
8
,
out0
);
vst1q_f32
(
out_p
+
12
,
out0
);
in_p
+=
16
;
out_p
+=
16
;
float32x4_t
in0
=
vld1q_f32
(
in_p
);
float32x4_t
in1
=
vld1q_f32
(
in_p
+
4
);
float32x4_t
in2
=
vld1q_f32
(
in_p
+
8
);
float32x4_t
in3
=
vld1q_f32
(
in_p
+
12
);
float32x4_t
submean0
=
vsubq_f32
(
in0
,
vmean
);
float32x4_t
submean1
=
vsubq_f32
(
in1
,
vmean
);
float32x4_t
submean2
=
vsubq_f32
(
in2
,
vmean
);
float32x4_t
submean3
=
vsubq_f32
(
in3
,
vmean
);
float32x4_t
out0
=
vmlaq_f32
(
vbias
,
submean0
,
vsstd
);
float32x4_t
out1
=
vmlaq_f32
(
vbias
,
submean1
,
vsstd
);
float32x4_t
out2
=
vmlaq_f32
(
vbias
,
submean2
,
vsstd
);
float32x4_t
out3
=
vmlaq_f32
(
vbias
,
submean3
,
vsstd
);
vst1q_f32
(
out_p
,
out0
);
vst1q_f32
(
out_p
+
4
,
out0
);
vst1q_f32
(
out_p
+
8
,
out0
);
vst1q_f32
(
out_p
+
12
,
out0
);
in_p
+=
16
;
out_p
+=
16
;
}
for
(
int
k
=
0
;
k
<
remain
-
3
;
k
+=
4
)
{
float32x4_t
in0
=
vld1q_f32
(
in_p
);
in_p
+=
4
;
float32x4_t
submean0
=
vsubq_f32
(
in0
,
vmean
);
float32x4_t
out0
=
vmlaq_f32
(
vbias
,
submean0
,
vsstd
);
vst1q_f32
(
out_p
,
out0
);
out_p
+=
4
;
float32x4_t
in0
=
vld1q_f32
(
in_p
);
in_p
+=
4
;
float32x4_t
submean0
=
vsubq_f32
(
in0
,
vmean
);
float32x4_t
out0
=
vmlaq_f32
(
vbias
,
submean0
,
vsstd
);
vst1q_f32
(
out_p
,
out0
);
out_p
+=
4
;
}
for
(
int
k
=
0
;
k
<
remain
%
4
;
k
++
)
{
*
out_p
=
(
*
in_p
-
mean_val
)
*
sstd_val
+
bias_val
;
in_p
++
;
out_p
++
;
*
out_p
=
(
*
in_p
-
mean_val
)
*
sstd_val
+
bias_val
;
in_p
++
;
out_p
++
;
}
}
}
...
...
lite/operators/deformable_conv_op.cc
浏览文件 @
c08fbb01
...
...
@@ -84,5 +84,4 @@ bool DeformableConvOpLite::InferShapeImpl() const {
}
// namespace lite
}
// namespace paddle
REGISTER_LITE_OP
(
deformconv2d
,
paddle
::
lite
::
operators
::
DeformableConvOpLite
);
REGISTER_LITE_OP
(
deformconv2d
,
paddle
::
lite
::
operators
::
DeformableConvOpLite
);
lite/operators/group_norm_op.cc
浏览文件 @
c08fbb01
...
...
@@ -39,8 +39,10 @@ bool GroupNormOp::CheckShape() const {
CHECK_EQ
(
bias_dims
.
size
(),
1UL
)
<<
"Input Bias must have 1 dimensions."
;
CHECK_GT
(
param_
.
epsilon
,
0.
f
)
<<
"epsilon should be greater than 0.f"
;
CHECK_LT
(
param_
.
epsilon
,
0.01
f
)
<<
"epsilon should be less than 0.01f"
;
CHECK_EQ
(
param_
.
channels
,
x_dims
[
1
])
<<
"Input channels must be equal input_shape[1]"
;
CHECK_EQ
(
param_
.
channels
%
param_
.
groups
,
0
)
<<
"channels must be divide groups"
;
CHECK_EQ
(
param_
.
channels
,
x_dims
[
1
])
<<
"Input channels must be equal input_shape[1]"
;
CHECK_EQ
(
param_
.
channels
%
param_
.
groups
,
0
)
<<
"channels must be divide groups"
;
return
true
;
}
...
...
@@ -54,8 +56,7 @@ bool GroupNormOp::InferShapeImpl() const {
return
true
;
}
bool
GroupNormOp
::
AttachImpl
(
const
cpp
::
OpDesc
&
op_desc
,
lite
::
Scope
*
scope
)
{
bool
GroupNormOp
::
AttachImpl
(
const
cpp
::
OpDesc
&
op_desc
,
lite
::
Scope
*
scope
)
{
param_
.
x
=
scope
->
FindVar
(
op_desc
.
Input
(
"X"
).
front
())
->
GetMutable
<
Tensor
>
();
param_
.
scale
=
scope
->
FindVar
(
op_desc
.
Input
(
"Scale"
).
front
())
->
GetMutable
<
Tensor
>
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录