Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
5d3d7514
Mace
项目概览
Xiaomi
/
Mace
通知
106
Star
40
Fork
27
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5d3d7514
编写于
9月 14, 2017
作者:
L
Liangliang He
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update conv2d unit tests and add benchmark for bad alignments
上级
37f93e09
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
16 addition
and
6 deletion
+16
-6
mace/ops/conv_2d_benchmark.cc
mace/ops/conv_2d_benchmark.cc
+3
-0
mace/ops/conv_2d_test.cc
mace/ops/conv_2d_test.cc
+13
-6
未找到文件。
mace/ops/conv_2d_benchmark.cc
浏览文件 @
5d3d7514
...
@@ -61,7 +61,10 @@ static void Conv2d(int iters, int batch, int channels, int height, int width,
...
@@ -61,7 +61,10 @@ static void Conv2d(int iters, int batch, int channels, int height, int width,
BM_CONV_2D_MACRO(N, C, H, W, KH, KW, S, P, OC, TYPE, NEON);
BM_CONV_2D_MACRO(N, C, H, W, KH, KW, S, P, OC, TYPE, NEON);
BM_CONV_2D
(
1
,
64
,
32
,
32
,
1
,
1
,
1
,
VALID
,
128
,
float
);
BM_CONV_2D
(
1
,
64
,
32
,
32
,
1
,
1
,
1
,
VALID
,
128
,
float
);
BM_CONV_2D
(
1
,
64
,
33
,
31
,
1
,
1
,
1
,
VALID
,
128
,
float
);
// Test bad alignments
BM_CONV_2D
(
1
,
64
,
32
,
32
,
3
,
3
,
1
,
VALID
,
128
,
float
);
BM_CONV_2D
(
1
,
64
,
32
,
32
,
3
,
3
,
1
,
VALID
,
128
,
float
);
BM_CONV_2D
(
1
,
64
,
33
,
31
,
3
,
3
,
1
,
VALID
,
128
,
float
);
BM_CONV_2D
(
1
,
64
,
32
,
32
,
3
,
3
,
1
,
SAME
,
128
,
float
);
BM_CONV_2D
(
1
,
64
,
32
,
32
,
3
,
3
,
1
,
SAME
,
128
,
float
);
BM_CONV_2D
(
1
,
64
,
33
,
31
,
3
,
3
,
1
,
SAME
,
128
,
float
);
}
// namespace mace
}
// namespace mace
mace/ops/conv_2d_test.cc
浏览文件 @
5d3d7514
...
@@ -192,8 +192,10 @@ TEST_F(Conv2dOpTest, Conv1x1) {
...
@@ -192,8 +192,10 @@ TEST_F(Conv2dOpTest, Conv1x1) {
}
}
// TODO we need more tests
// TODO we need more tests
TEST_F
(
Conv2dOpTest
,
Conv3x3R1
)
{
TEST_F
(
Conv2dOpTest
,
ConvNxNS12
)
{
auto
func
=
[
&
](
Padding
type
)
{
auto
func
=
[
&
](
int
kernel_h
,
int
kernel_w
,
int
stride_h
,
int
stride_w
,
Padding
type
)
{
srand
(
time
(
NULL
));
srand
(
time
(
NULL
));
// generate random input
// generate random input
...
@@ -212,13 +214,14 @@ TEST_F(Conv2dOpTest, Conv3x3R1) {
...
@@ -212,13 +214,14 @@ TEST_F(Conv2dOpTest, Conv3x3R1) {
.
Finalize
(
net
.
operator_def
());
.
Finalize
(
net
.
operator_def
());
// Add args
// Add args
net
.
AddIntsArg
(
"strides"
,
{
1
,
1
});
net
.
AddIntsArg
(
"strides"
,
{
stride_h
,
stride_w
});
net
.
AddIntArg
(
"padding"
,
type
);
net
.
AddIntArg
(
"padding"
,
type
);
net
.
AddIntsArg
(
"dilations"
,
{
1
,
1
});
net
.
AddIntsArg
(
"dilations"
,
{
1
,
1
});
// Add input data
// Add input data
net
.
AddRandomInput
<
float
>
(
"Input"
,
{
batch
,
input_channels
,
height
,
width
});
net
.
AddRandomInput
<
float
>
(
"Input"
,
{
batch
,
input_channels
,
height
,
width
});
net
.
AddRandomInput
<
float
>
(
"Filter"
,
{
output_channels
,
input_channels
,
3
,
3
});
net
.
AddRandomInput
<
float
>
(
"Filter"
,
{
output_channels
,
input_channels
,
kernel_h
,
kernel_w
});
net
.
AddRandomInput
<
float
>
(
"Bias"
,
{
output_channels
});
net
.
AddRandomInput
<
float
>
(
"Bias"
,
{
output_channels
});
// run cpu
// run cpu
net
.
RunOp
();
net
.
RunOp
();
...
@@ -233,6 +236,10 @@ TEST_F(Conv2dOpTest, Conv3x3R1) {
...
@@ -233,6 +236,10 @@ TEST_F(Conv2dOpTest, Conv3x3R1) {
};
};
func
(
VALID
);
for
(
int
kernel_size
:
{
1
,
3
})
{
func
(
SAME
);
for
(
int
stride
:
{
1
,
2
})
{
func
(
kernel_size
,
kernel_size
,
stride
,
stride
,
VALID
);
func
(
kernel_size
,
kernel_size
,
stride
,
stride
,
SAME
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录