Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
60fa8386
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看板
提交
60fa8386
编写于
6月 12, 2020
作者:
C
chenjiaoAngel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix format. test=develop
上级
aa98e4c6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
7 deletion
+2
-7
lite/kernels/arm/group_norm_compute.cc
lite/kernels/arm/group_norm_compute.cc
+0
-1
lite/tests/kernels/group_norm_compute_test.cc
lite/tests/kernels/group_norm_compute_test.cc
+2
-6
未找到文件。
lite/kernels/arm/group_norm_compute.cc
浏览文件 @
60fa8386
...
@@ -44,7 +44,6 @@ void GroupNormCompute::Run() {
...
@@ -44,7 +44,6 @@ void GroupNormCompute::Run() {
int
ngroup
=
n
*
groups
;
int
ngroup
=
n
*
groups
;
int
cnt
=
spatial_size
>>
4
;
int
cnt
=
spatial_size
>>
4
;
int
remain
=
spatial_size
%
16
;
int
remain
=
spatial_size
%
16
;
LOG
(
INFO
)
<<
"param.y dims: "
<<
param
.
out
->
dims
();
// compute saved_mean and saved_variance
// compute saved_mean and saved_variance
#pragma omp parallel for
#pragma omp parallel for
for
(
int
n
=
0
;
n
<
ngroup
;
++
n
)
{
for
(
int
n
=
0
;
n
<
ngroup
;
++
n
)
{
...
...
lite/tests/kernels/group_norm_compute_test.cc
浏览文件 @
60fa8386
...
@@ -75,7 +75,6 @@ class GroupNormComputeTest : public arena::TestCase {
...
@@ -75,7 +75,6 @@ class GroupNormComputeTest : public arena::TestCase {
int
ch_per_group
=
channels_
/
groups_
;
int
ch_per_group
=
channels_
/
groups_
;
CHECK_EQ
(
x
->
dims
()[
1
],
channels_
);
CHECK_EQ
(
x
->
dims
()[
1
],
channels_
);
int
spatial_size
=
ch_per_group
*
x
->
dims
()[
2
]
*
x
->
dims
()[
3
];
int
spatial_size
=
ch_per_group
*
x
->
dims
()[
2
]
*
x
->
dims
()[
3
];
LOG
(
INFO
)
<<
"base dims: "
<<
y
->
dims
();
// compute mean
// compute mean
for
(
int
i
=
0
;
i
<
n
*
groups_
;
++
i
)
{
for
(
int
i
=
0
;
i
<
n
*
groups_
;
++
i
)
{
const
float
*
x_ptr
=
x_data
+
i
*
spatial_size
;
const
float
*
x_ptr
=
x_data
+
i
*
spatial_size
;
...
@@ -94,7 +93,6 @@ class GroupNormComputeTest : public arena::TestCase {
...
@@ -94,7 +93,6 @@ class GroupNormComputeTest : public arena::TestCase {
(
x_ptr
[
j
]
-
saved_mean_data
[
i
])
*
(
x_ptr
[
j
]
-
saved_mean_data
[
i
]);
(
x_ptr
[
j
]
-
saved_mean_data
[
i
])
*
(
x_ptr
[
j
]
-
saved_mean_data
[
i
]);
}
}
saved_variance_data
[
i
]
=
1.
f
/
sqrtf
(
sum
/
spatial_size
+
epsilon_
);
saved_variance_data
[
i
]
=
1.
f
/
sqrtf
(
sum
/
spatial_size
+
epsilon_
);
LOG
(
INFO
)
<<
"i: "
<<
i
<<
", means: "
<<
saved_mean_data
[
i
]
<<
", saved_variance_data: "
<<
saved_variance_data
[
i
];
}
}
int
in_size
=
x
->
dims
()[
2
]
*
x
->
dims
()[
3
];
int
in_size
=
x
->
dims
()[
2
]
*
x
->
dims
()[
3
];
// compute out
// compute out
...
@@ -151,17 +149,15 @@ void TestGroupNorm(Place place,
...
@@ -151,17 +149,15 @@ void TestGroupNorm(Place place,
float
abs_error
=
6e-5
,
float
abs_error
=
6e-5
,
std
::
vector
<
std
::
string
>
ignored_outs
=
{})
{
std
::
vector
<
std
::
string
>
ignored_outs
=
{})
{
for
(
auto
&
n
:
{
1
,
3
,
16
})
{
for
(
auto
&
n
:
{
1
,
3
,
16
})
{
for
(
auto
&
c
:
{
1
,
4
,
16
})
{
for
(
auto
&
c
:
{
1
})
{
for
(
auto
&
h
:
{
1
,
16
,
33
,
56
})
{
for
(
auto
&
h
:
{
1
,
16
,
33
,
56
})
{
for
(
auto
&
w
:
{
1
,
17
,
34
,
55
})
{
for
(
auto
&
w
:
{
1
,
17
,
55
})
{
for
(
auto
&
groups
:
{
1
,
2
,
4
})
{
for
(
auto
&
groups
:
{
1
,
2
,
4
})
{
if
(
c
%
groups
!=
0
)
{
if
(
c
%
groups
!=
0
)
{
continue
;
continue
;
}
}
DDim
dim_in
({
n
,
c
,
h
,
w
});
DDim
dim_in
({
n
,
c
,
h
,
w
});
float
epsilon
=
1e-5
f
;
float
epsilon
=
1e-5
f
;
LOG
(
INFO
)
<<
"input shape: "
<<
n
<<
", "
<<
c
<<
", "
<<
h
<<
", "
<<
w
;
LOG
(
INFO
)
<<
"groups: "
<<
groups
;
std
::
unique_ptr
<
arena
::
TestCase
>
tester
(
std
::
unique_ptr
<
arena
::
TestCase
>
tester
(
new
GroupNormComputeTest
(
place
,
"def"
,
dim_in
,
epsilon
,
groups
,
c
));
new
GroupNormComputeTest
(
place
,
"def"
,
dim_in
,
epsilon
,
groups
,
c
));
#ifdef LITE_WITH_ARM
#ifdef LITE_WITH_ARM
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录