Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
087b477e
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,发现更多精彩内容 >>
提交
087b477e
编写于
6月 08, 2018
作者:
叶
叶剑武
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'benchmark-bug' into 'master'
Remove unsed definition in api of mace.h See merge request !571
上级
7feb1dd3
bf295fb8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
17 deletion
+18
-17
mace/benchmark/BUILD
mace/benchmark/BUILD
+0
-1
mace/benchmark/statistics.cc
mace/benchmark/statistics.cc
+9
-10
mace/benchmark/statistics.h
mace/benchmark/statistics.h
+2
-2
mace/core/net.cc
mace/core/net.cc
+6
-2
mace/public/mace.h
mace/public/mace.h
+1
-2
未找到文件。
mace/benchmark/BUILD
浏览文件 @
087b477e
...
@@ -15,7 +15,6 @@ cc_library(
...
@@ -15,7 +15,6 @@ cc_library(
hdrs
=
[
"statistics.h"
],
hdrs
=
[
"statistics.h"
],
copts
=
[
"-Werror"
,
"-Wextra"
,
"-Wno-missing-field-initializers"
],
copts
=
[
"-Werror"
,
"-Wextra"
,
"-Wno-missing-field-initializers"
],
deps
=
[
deps
=
[
"//mace/kernels"
,
"//mace/utils"
,
"//mace/utils"
,
],
],
)
)
...
...
mace/benchmark/statistics.cc
浏览文件 @
087b477e
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
#include <set>
#include <set>
#include "mace/kernels/conv_pool_2d_util.h"
#include "mace/utils/logging.h"
#include "mace/utils/logging.h"
#include "mace/utils/string_util.h"
#include "mace/utils/string_util.h"
...
@@ -39,18 +38,18 @@ std::string MetricToString(const Metric metric) {
...
@@ -39,18 +38,18 @@ std::string MetricToString(const Metric metric) {
std
::
string
PaddingTypeToString
(
int
padding_type
)
{
std
::
string
PaddingTypeToString
(
int
padding_type
)
{
std
::
stringstream
stream
;
std
::
stringstream
stream
;
Padding
type
=
static_cast
<
Padding
>
(
padding_type
);
switch
(
padding_type
)
{
switch
(
type
)
{
case
0
:
stream
<<
"VALID"
;
break
;
case
VALID
:
stream
<<
"VALID"
;
break
;
case
1
:
stream
<<
"SAME"
;
break
;
case
SAME
:
stream
<<
"SAME"
;
break
;
case
2
:
stream
<<
"FULL"
;
break
;
case
FULL
:
stream
<<
"FULL"
;
break
;
default:
stream
<<
padding_type
;
break
;
default:
stream
<<
padding_type
;
break
;
}
}
return
stream
.
str
();
return
stream
.
str
();
}
}
std
::
string
ShapeToString
(
const
std
::
vector
<
OutputShape
>
&
output_shape
)
{
std
::
string
ShapeToString
(
const
std
::
vector
<
std
::
vector
<
int64_t
>>
&
output_shape
)
{
if
(
output_shape
.
empty
())
{
if
(
output_shape
.
empty
())
{
return
""
;
return
""
;
}
}
...
@@ -58,9 +57,9 @@ std::string ShapeToString(const std::vector<OutputShape> &output_shape) {
...
@@ -58,9 +57,9 @@ std::string ShapeToString(const std::vector<OutputShape> &output_shape) {
std
::
stringstream
stream
;
std
::
stringstream
stream
;
stream
<<
"["
;
stream
<<
"["
;
for
(
size_t
i
=
0
;
i
<
output_shape
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
output_shape
.
size
();
++
i
)
{
size_t
dims_size
=
output_shape
[
i
].
dims_
size
();
size_t
dims_size
=
output_shape
[
i
].
size
();
for
(
size_t
j
=
0
;
j
<
dims_size
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
dims_size
;
++
j
)
{
stream
<<
output_shape
[
i
]
.
dims
(
j
)
;
stream
<<
output_shape
[
i
]
[
j
]
;
if
(
j
!=
dims_size
-
1
)
{
if
(
j
!=
dims_size
-
1
)
{
stream
<<
","
;
stream
<<
","
;
}
}
...
@@ -176,7 +175,7 @@ std::string OpStat::StatByMetric(const Metric metric,
...
@@ -176,7 +175,7 @@ std::string OpStat::StatByMetric(const Metric metric,
}
else
{
}
else
{
tuple
.
push_back
(
VectorToString
<
int
>
(
record
.
args
.
paddings
));
tuple
.
push_back
(
VectorToString
<
int
>
(
record
.
args
.
paddings
));
}
}
tuple
.
push_back
(
VectorToString
<
in
dex
_t
>
(
record
.
args
.
kernels
));
tuple
.
push_back
(
VectorToString
<
in
t64
_t
>
(
record
.
args
.
kernels
));
tuple
.
push_back
(
ShapeToString
(
record
.
output_shape
));
tuple
.
push_back
(
ShapeToString
(
record
.
output_shape
));
tuple
.
push_back
(
VectorToString
<
int
>
(
record
.
args
.
dilations
));
tuple
.
push_back
(
VectorToString
<
int
>
(
record
.
args
.
dilations
));
tuple
.
push_back
(
record
.
name
);
tuple
.
push_back
(
record
.
name
);
...
...
mace/benchmark/statistics.h
浏览文件 @
087b477e
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
#include "mace/
kernels/conv_pool_2d_util
.h"
#include "mace/
public/mace
.h"
#include "mace/utils/string_util.h"
#include "mace/utils/string_util.h"
namespace
mace
{
namespace
mace
{
...
@@ -142,7 +142,7 @@ class OpStat{
...
@@ -142,7 +142,7 @@ class OpStat{
struct
Record
{
struct
Record
{
std
::
string
name
;
std
::
string
name
;
std
::
string
type
;
std
::
string
type
;
std
::
vector
<
OutputShape
>
output_shape
;
std
::
vector
<
std
::
vector
<
int64_t
>
>
output_shape
;
ConvPoolArgs
args
;
ConvPoolArgs
args
;
int64_t
order
;
int64_t
order
;
TimeInfo
<
int64_t
>
start
;
TimeInfo
<
int64_t
>
start
;
...
...
mace/core/net.cc
浏览文件 @
087b477e
...
@@ -108,9 +108,13 @@ MaceStatus SerialNet::Run(RunMetadata *run_metadata) {
...
@@ -108,9 +108,13 @@ MaceStatus SerialNet::Run(RunMetadata *run_metadata) {
}
}
}
}
std
::
vector
<
std
::
vector
<
int64_t
>>
output_shapes
;
for
(
auto
output_shape
:
op
->
debug_def
().
output_shape
())
{
output_shapes
.
push_back
({
output_shape
.
dims
().
begin
(),
output_shape
.
dims
().
end
()});
}
OperatorStats
op_stats
=
{
op
->
debug_def
().
name
(),
op
->
debug_def
().
type
(),
OperatorStats
op_stats
=
{
op
->
debug_def
().
name
(),
op
->
debug_def
().
type
(),
{
op
->
debug_def
().
output_shape
().
begin
(),
output_shapes
,
op
->
debug_def
().
output_shape
().
end
()},
{
strides
,
padding_type
,
paddings
,
dilations
,
{
strides
,
padding_type
,
paddings
,
dilations
,
kernels
},
call_stats
};
kernels
},
call_stats
};
run_metadata
->
op_stats
.
emplace_back
(
op_stats
);
run_metadata
->
op_stats
.
emplace_back
(
op_stats
);
...
...
mace/public/mace.h
浏览文件 @
087b477e
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
namespace
mace
{
namespace
mace
{
class
OutputShape
;
class
NetDef
;
class
NetDef
;
enum
DeviceType
{
CPU
=
0
,
GPU
=
2
,
HEXAGON
=
3
};
enum
DeviceType
{
CPU
=
0
,
GPU
=
2
,
HEXAGON
=
3
};
...
@@ -47,7 +46,7 @@ struct ConvPoolArgs {
...
@@ -47,7 +46,7 @@ struct ConvPoolArgs {
struct
OperatorStats
{
struct
OperatorStats
{
std
::
string
operator_name
;
std
::
string
operator_name
;
std
::
string
type
;
std
::
string
type
;
std
::
vector
<
OutputShape
>
output_shape
;
std
::
vector
<
std
::
vector
<
int64_t
>
>
output_shape
;
ConvPoolArgs
args
;
ConvPoolArgs
args
;
CallStats
stats
;
CallStats
stats
;
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录