Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
Mace
提交
e64de054
Mace
项目概览
慢慢CG
/
Mace
与 Fork 源项目一致
Fork自
Xiaomi / Mace
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e64de054
编写于
9月 08, 2017
作者:
L
liuqi
提交者:
wuchenghui
9月 11, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update to new index typedef for batch_norm related code.
上级
b711b557
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
8 deletion
+8
-8
mace/kernels/benchmark/batch_norm_benchmark.cc
mace/kernels/benchmark/batch_norm_benchmark.cc
+2
-2
mace/kernels/test/batch_norm_neon_test.cc
mace/kernels/test/batch_norm_neon_test.cc
+6
-6
未找到文件。
mace/kernels/benchmark/batch_norm_benchmark.cc
浏览文件 @
e64de054
...
@@ -13,7 +13,7 @@ static void BatchNorm(int iters, int batch, int channels, int height, int width)
...
@@ -13,7 +13,7 @@ static void BatchNorm(int iters, int batch, int channels, int height, int width)
std
::
mt19937
gen
(
rd
());
std
::
mt19937
gen
(
rd
());
std
::
normal_distribution
<
float
>
nd
(
0
,
1
);
std
::
normal_distribution
<
float
>
nd
(
0
,
1
);
TIndex
input_size
=
batch
*
channels
*
height
*
width
;
index_t
input_size
=
batch
*
channels
*
height
*
width
;
std
::
vector
<
T
>
input
(
input_size
,
0.0
);
std
::
vector
<
T
>
input
(
input_size
,
0.0
);
std
::
vector
<
T
>
scale
(
channels
,
0.0
);
std
::
vector
<
T
>
scale
(
channels
,
0.0
);
std
::
vector
<
T
>
offset
(
channels
,
0.0
);
std
::
vector
<
T
>
offset
(
channels
,
0.0
);
...
@@ -50,7 +50,7 @@ static void BatchNorm(int iters, int batch, int channels, int height, int width)
...
@@ -50,7 +50,7 @@ static void BatchNorm(int iters, int batch, int channels, int height, int width)
#define BM_BATCH_NORM_MACRO(N, C, H, W, TYPE, DEVICE) \
#define BM_BATCH_NORM_MACRO(N, C, H, W, TYPE, DEVICE) \
static void BM_BATCH_NORM_##N##_##C##_##H##_##W##_##TYPE##_##DEVICE( \
static void BM_BATCH_NORM_##N##_##C##_##H##_##W##_##TYPE##_##DEVICE( \
int iters) { \
int iters) { \
const int64
tot = static_cast<int64
>(iters) * N * C * H * W; \
const int64
_t tot = static_cast<int64_t
>(iters) * N * C * H * W; \
mace::testing::ItemsProcessed(tot); \
mace::testing::ItemsProcessed(tot); \
mace::testing::BytesProcessed(tot * (sizeof(TYPE)));\
mace::testing::BytesProcessed(tot * (sizeof(TYPE)));\
BatchNorm<DEVICE, TYPE>(iters, N, C, H, W); \
BatchNorm<DEVICE, TYPE>(iters, N, C, H, W); \
...
...
mace/kernels/test/batch_norm_neon_test.cc
浏览文件 @
e64de054
...
@@ -15,12 +15,12 @@ TEST(BatchNormNeonTest, Simple) {
...
@@ -15,12 +15,12 @@ TEST(BatchNormNeonTest, Simple) {
srand
(
time
(
NULL
));
srand
(
time
(
NULL
));
// generate random input
// generate random input
TIndex
batch
=
1
+
rand
()
%
128
;
index_t
batch
=
1
+
rand
()
%
128
;
TIndex
channels
=
3
;
index_t
channels
=
3
;
TIndex
height
=
2
+
rand
()
%
100
;
index_t
height
=
2
+
rand
()
%
100
;
TIndex
width
=
2
+
rand
()
%
100
;
index_t
width
=
2
+
rand
()
%
100
;
TIndex
input_size
=
batch
*
channels
*
height
*
width
;
index_t
input_size
=
batch
*
channels
*
height
*
width
;
std
::
vector
<
float
>
input
(
input_size
,
0.0
);
std
::
vector
<
float
>
input
(
input_size
,
0.0
);
std
::
vector
<
float
>
scale
(
channels
,
0.0
);
std
::
vector
<
float
>
scale
(
channels
,
0.0
);
std
::
vector
<
float
>
offset
(
channels
,
0.0
);
std
::
vector
<
float
>
offset
(
channels
,
0.0
);
...
@@ -64,7 +64,7 @@ TEST(BatchNormNeonTest, Simple) {
...
@@ -64,7 +64,7 @@ TEST(BatchNormNeonTest, Simple) {
output_neon
.
get
()
output_neon
.
get
()
);
);
for
(
TIndex
i
=
0
;
i
<
input_size
;
++
i
)
{
for
(
index_t
i
=
0
;
i
<
input_size
;
++
i
)
{
EXPECT_FLOAT_EQ
(
output
[
i
],
output_neon
[
i
]);
EXPECT_FLOAT_EQ
(
output
[
i
],
output_neon
[
i
]);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录