Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
198344e7
Mace
项目概览
Xiaomi
/
Mace
通知
107
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看板
提交
198344e7
编写于
2月 28, 2018
作者:
L
Liangliang He
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor fixes about logging and const tensor interface
上级
751fd049
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
16 addition
and
15 deletion
+16
-15
mace/core/mace.cc
mace/core/mace.cc
+2
-2
mace/core/net.cc
mace/core/net.cc
+3
-5
mace/core/workspace.cc
mace/core/workspace.cc
+4
-4
mace/public/mace.h
mace/public/mace.h
+2
-2
mace/utils/logging.h
mace/utils/logging.h
+1
-0
tools/export_lib.sh
tools/export_lib.sh
+4
-2
未找到文件。
mace/core/mace.cc
浏览文件 @
198344e7
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
namespace
mace
{
namespace
mace
{
ConstTensor
::
ConstTensor
(
const
std
::
string
&
name
,
ConstTensor
::
ConstTensor
(
const
std
::
string
&
name
,
unsigned
char
*
data
,
const
unsigned
char
*
data
,
const
std
::
vector
<
int64_t
>
&
dims
,
const
std
::
vector
<
int64_t
>
&
dims
,
const
DataType
data_type
,
const
DataType
data_type
,
uint32_t
node_id
)
:
uint32_t
node_id
)
:
...
@@ -23,7 +23,7 @@ ConstTensor::ConstTensor(const std::string &name,
...
@@ -23,7 +23,7 @@ ConstTensor::ConstTensor(const std::string &name,
node_id_
(
node_id
)
{}
node_id_
(
node_id
)
{}
ConstTensor
::
ConstTensor
(
const
std
::
string
&
name
,
ConstTensor
::
ConstTensor
(
const
std
::
string
&
name
,
unsigned
char
*
data
,
const
unsigned
char
*
data
,
const
std
::
vector
<
int64_t
>
&
dims
,
const
std
::
vector
<
int64_t
>
&
dims
,
const
int
data_type
,
const
int
data_type
,
uint32_t
node_id
)
:
uint32_t
node_id
)
:
...
...
mace/core/net.cc
浏览文件 @
198344e7
...
@@ -22,7 +22,7 @@ SimpleNet::SimpleNet(const std::shared_ptr<const OperatorRegistry> op_registry,
...
@@ -22,7 +22,7 @@ SimpleNet::SimpleNet(const std::shared_ptr<const OperatorRegistry> op_registry,
const
NetMode
mode
)
const
NetMode
mode
)
:
NetBase
(
op_registry
,
net_def
,
ws
,
type
),
:
NetBase
(
op_registry
,
net_def
,
ws
,
type
),
device_type_
(
type
)
{
device_type_
(
type
)
{
VLOG
(
1
)
<<
"Constructing SimpleNet "
<<
net_def
->
name
(
);
MACE_LATENCY_LOGGER
(
1
,
"Constructing SimpleNet "
,
net_def
->
name
()
);
for
(
int
idx
=
0
;
idx
<
net_def
->
op_size
();
++
idx
)
{
for
(
int
idx
=
0
;
idx
<
net_def
->
op_size
();
++
idx
)
{
const
auto
&
operator_def
=
net_def
->
op
(
idx
);
const
auto
&
operator_def
=
net_def
->
op
(
idx
);
VLOG
(
3
)
<<
"Creating operator "
<<
operator_def
.
name
()
<<
"("
VLOG
(
3
)
<<
"Creating operator "
<<
operator_def
.
name
()
<<
"("
...
@@ -41,10 +41,8 @@ bool SimpleNet::Run(RunMetadata *run_metadata) {
...
@@ -41,10 +41,8 @@ bool SimpleNet::Run(RunMetadata *run_metadata) {
MACE_LATENCY_LOGGER
(
1
,
"Running net"
);
MACE_LATENCY_LOGGER
(
1
,
"Running net"
);
for
(
auto
iter
=
operators_
.
begin
();
iter
!=
operators_
.
end
();
++
iter
)
{
for
(
auto
iter
=
operators_
.
begin
();
iter
!=
operators_
.
end
();
++
iter
)
{
auto
&
op
=
*
iter
;
auto
&
op
=
*
iter
;
VLOG
(
3
)
<<
"Running operator "
<<
op
->
debug_def
().
name
()
<<
"("
MACE_LATENCY_LOGGER
(
2
,
"Running operator "
,
op
->
debug_def
().
name
(),
<<
op
->
debug_def
().
type
()
<<
")."
;
"("
,
op
->
debug_def
().
type
(),
")"
);
MACE_LATENCY_LOGGER
(
2
,
"Running operator "
,
op
->
debug_def
().
name
());
bool
future_wait
=
(
device_type_
==
DeviceType
::
OPENCL
&&
bool
future_wait
=
(
device_type_
==
DeviceType
::
OPENCL
&&
(
run_metadata
!=
nullptr
||
(
run_metadata
!=
nullptr
||
std
::
distance
(
iter
,
operators_
.
end
())
==
1
));
std
::
distance
(
iter
,
operators_
.
end
())
==
1
));
...
...
mace/core/workspace.cc
浏览文件 @
198344e7
...
@@ -74,9 +74,9 @@ void Workspace::LoadModelTensor(const NetDef &net_def, DeviceType type) {
...
@@ -74,9 +74,9 @@ void Workspace::LoadModelTensor(const NetDef &net_def, DeviceType type) {
Serializer
serializer
;
Serializer
serializer
;
for
(
auto
&
tensor_proto
:
net_def
.
tensors
())
{
for
(
auto
&
tensor_proto
:
net_def
.
tensors
())
{
MACE_LATENCY_LOGGER
(
2
,
"Load tensor "
,
tensor_proto
.
name
());
MACE_LATENCY_LOGGER
(
2
,
"Load tensor "
,
tensor_proto
.
name
());
VLOG
(
3
)
<<
"
Load tensor
: "
<<
tensor_proto
.
name
()
VLOG
(
3
)
<<
"
Tensor name
: "
<<
tensor_proto
.
name
()
<<
",
with
data type: "
<<
tensor_proto
.
data_type
()
<<
", data type: "
<<
tensor_proto
.
data_type
()
<<
",
has
shape: "
<<
", shape: "
<<
MakeString
(
std
::
vector
<
index_t
>
(
tensor_proto
.
dims
().
begin
(),
<<
MakeString
(
std
::
vector
<
index_t
>
(
tensor_proto
.
dims
().
begin
(),
tensor_proto
.
dims
().
end
()));
tensor_proto
.
dims
().
end
()));
tensor_map_
[
tensor_proto
.
name
()]
=
tensor_map_
[
tensor_proto
.
name
()]
=
...
...
mace/public/mace.h
浏览文件 @
198344e7
...
@@ -73,12 +73,12 @@ enum DataType {
...
@@ -73,12 +73,12 @@ enum DataType {
class
ConstTensor
{
class
ConstTensor
{
public:
public:
ConstTensor
(
const
std
::
string
&
name
,
ConstTensor
(
const
std
::
string
&
name
,
unsigned
char
*
data
,
const
unsigned
char
*
data
,
const
std
::
vector
<
int64_t
>
&
dims
,
const
std
::
vector
<
int64_t
>
&
dims
,
const
DataType
data_type
=
DT_FLOAT
,
const
DataType
data_type
=
DT_FLOAT
,
uint32_t
node_id
=
0
);
uint32_t
node_id
=
0
);
ConstTensor
(
const
std
::
string
&
name
,
ConstTensor
(
const
std
::
string
&
name
,
unsigned
char
*
data
,
const
unsigned
char
*
data
,
const
std
::
vector
<
int64_t
>
&
dims
,
const
std
::
vector
<
int64_t
>
&
dims
,
const
int
data_type
,
const
int
data_type
,
uint32_t
node_id
=
0
);
uint32_t
node_id
=
0
);
...
...
mace/utils/logging.h
浏览文件 @
198344e7
...
@@ -113,6 +113,7 @@ class LatencyLogger {
...
@@ -113,6 +113,7 @@ class LatencyLogger {
:
vlog_level_
(
vlog_level
),
message_
(
message
)
{
:
vlog_level_
(
vlog_level
),
message_
(
message
)
{
if
(
VLOG_IS_ON
(
vlog_level_
))
{
if
(
VLOG_IS_ON
(
vlog_level_
))
{
start_micros_
=
NowMicros
();
start_micros_
=
NowMicros
();
VLOG
(
vlog_level_
)
<<
message_
<<
" started"
;
}
}
}
}
~
LatencyLogger
()
{
~
LatencyLogger
()
{
...
...
tools/export_lib.sh
浏览文件 @
198344e7
...
@@ -161,8 +161,10 @@ rm -rf ${EXPORT_LIB_DIR}
...
@@ -161,8 +161,10 @@ rm -rf ${EXPORT_LIB_DIR}
mkdir
-p
${
EXPORT_LIB_DIR
}
mkdir
-p
${
EXPORT_LIB_DIR
}
cp
${
MACE_SOURCE_DIR
}
/mace/public/
*
.h
${
EXPORT_INCLUDE_DIR
}
/mace/public/
||
exit
1
cp
${
MACE_SOURCE_DIR
}
/mace/public/
*
.h
${
EXPORT_INCLUDE_DIR
}
/mace/public/
||
exit
1
# utils is noti part of public API
# utils is not part of public API
cp
${
MACE_SOURCE_DIR
}
/mace/utils/
*
.h
${
EXPORT_INCLUDE_DIR
}
/mace/utils/
||
exit
1
cp
${
MACE_SOURCE_DIR
}
/mace/utils/env_time.h
${
EXPORT_INCLUDE_DIR
}
/mace/utils/
||
exit
1
cp
${
MACE_SOURCE_DIR
}
/mace/utils/logging.h
${
EXPORT_INCLUDE_DIR
}
/mace/utils/
||
exit
1
cp
${
MACE_SOURCE_DIR
}
/mace/utils/string_util.h
${
EXPORT_INCLUDE_DIR
}
/mace/utils/
||
exit
1
cp
${
LIBMACE_TEMP_DIR
}
/libmace.a
${
LIBMACE_TEMP_DIR
}
/libmace_dev.a
${
LIBMACE_TEMP_DIR
}
/libmace_prod.a
${
EXPORT_LIB_DIR
}
/
||
exit
1
cp
${
LIBMACE_TEMP_DIR
}
/libmace.a
${
LIBMACE_TEMP_DIR
}
/libmace_dev.a
${
LIBMACE_TEMP_DIR
}
/libmace_prod.a
${
EXPORT_LIB_DIR
}
/
||
exit
1
echo
"Step 6: Remove temporary file"
echo
"Step 6: Remove temporary file"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录