Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
Mace
提交
f291ce31
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看板
提交
f291ce31
编写于
12月 21, 2017
作者:
L
liuqi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add version api.
上级
9fc3e2e1
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
89 addition
and
23 deletion
+89
-23
mace/codegen/BUILD
mace/codegen/BUILD
+11
-0
mace/core/BUILD
mace/core/BUILD
+1
-1
mace/core/allocator.h
mace/core/allocator.h
+1
-1
mace/core/arg_helper.h
mace/core/arg_helper.h
+1
-1
mace/core/mace.cc
mace/core/mace.cc
+2
-3
mace/core/net.h
mace/core/net.h
+1
-1
mace/core/operator.h
mace/core/operator.h
+1
-1
mace/core/public/mace.h
mace/core/public/mace.h
+0
-0
mace/core/public/version.h
mace/core/public/version.h
+26
-0
mace/core/serializer.h
mace/core/serializer.h
+1
-1
mace/core/tensor.h
mace/core/tensor.h
+1
-1
mace/core/types.h
mace/core/types.h
+1
-1
mace/core/workspace.h
mace/core/workspace.h
+1
-1
mace/examples/mace_run.cc
mace/examples/mace_run.cc
+6
-2
mace/kernels/batch_norm.h
mace/kernels/batch_norm.h
+1
-1
mace/kernels/bias_add.h
mace/kernels/bias_add.h
+1
-1
mace/kernels/concat.h
mace/kernels/concat.h
+1
-1
mace/kernels/depthwise_conv2d.h
mace/kernels/depthwise_conv2d.h
+1
-1
mace/kernels/space_to_batch.h
mace/kernels/space_to_batch.h
+1
-1
mace/ops/concat.h
mace/ops/concat.h
+0
-1
mace/python/tools/model.template
mace/python/tools/model.template
+3
-3
mace/tools/git/gen_version_source.sh
mace/tools/git/gen_version_source.sh
+21
-0
tools/validate_gcn.sh
tools/validate_gcn.sh
+6
-0
未找到文件。
mace/codegen/BUILD
浏览文件 @
f291ce31
...
@@ -15,6 +15,7 @@ cc_library(
...
@@ -15,6 +15,7 @@ cc_library(
deps
=
[
deps
=
[
"//mace/core"
,
"//mace/core"
,
"//mace/ops"
,
"//mace/ops"
,
'//mace/codegen:version_lib'
,
]
+
if_embed_binary_program
([
]
+
if_embed_binary_program
([
'//mace/codegen:generated_opencl_lib'
,
'//mace/codegen:generated_opencl_lib'
,
'//mace/codegen:generated_tuning_lib'
,
'//mace/codegen:generated_tuning_lib'
,
...
@@ -34,3 +35,13 @@ cc_library(
...
@@ -34,3 +35,13 @@ cc_library(
copts
=
[
"-std=c++11"
,
"-D_GLIBCXX_USE_C99_MATH_TR1"
],
copts
=
[
"-std=c++11"
,
"-D_GLIBCXX_USE_C99_MATH_TR1"
],
linkstatic
=
1
,
linkstatic
=
1
,
)
)
cc_library
(
name
=
"version_lib"
,
srcs
=
glob
([
"version/*.cc"
]),
copts
=
[
"-std=c++11"
,
"-D_GLIBCXX_USE_C99_MATH_TR1"
],
linkstatic
=
1
,
deps
=
[
"//mace/core"
,
]
)
mace/core/BUILD
浏览文件 @
f291ce31
...
@@ -35,7 +35,7 @@ cc_library(
...
@@ -35,7 +35,7 @@ cc_library(
cc_library
(
cc_library
(
name
=
"core"
,
name
=
"core"
,
srcs
=
glob
([
"*.cc"
]),
srcs
=
glob
([
"*.cc"
]),
hdrs
=
glob
([
"*.h"
]),
hdrs
=
glob
([
"*.h"
,
"public/*.h"
]),
copts
=
[
"-std=c++11"
,
"-D_GLIBCXX_USE_C99_MATH_TR1"
],
copts
=
[
"-std=c++11"
,
"-D_GLIBCXX_USE_C99_MATH_TR1"
],
linkopts
=
if_android
([
"-pie"
]),
linkopts
=
if_android
([
"-pie"
]),
deps
=
[
deps
=
[
...
...
mace/core/allocator.h
浏览文件 @
f291ce31
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include <malloc.h>
#include <malloc.h>
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/core/registry.h"
#include "mace/core/registry.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
#include "mace/core/types.h"
#include "mace/core/types.h"
namespace
mace
{
namespace
mace
{
...
...
mace/core/arg_helper.h
浏览文件 @
f291ce31
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <map>
#include <map>
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
...
...
mace/core/mace.cc
浏览文件 @
f291ce31
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Copyright (c) 2017 XiaoMi All rights reserved.
// Copyright (c) 2017 XiaoMi All rights reserved.
//
//
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
#include "mace/core/types.h"
#include "mace/core/types.h"
#include "mace/core/net.h"
#include "mace/core/net.h"
#include "mace/core/workspace.h"
#include "mace/core/workspace.h"
...
@@ -495,8 +495,7 @@ MaceEngine::MaceEngine(const NetDef *net_def, DeviceType device_type):
...
@@ -495,8 +495,7 @@ MaceEngine::MaceEngine(const NetDef *net_def, DeviceType device_type):
ws_
->
CreateTensor
(
"mace_input_node:0"
,
GetDeviceAllocator
(
device_type_
),
DT_FLOAT
);
ws_
->
CreateTensor
(
"mace_input_node:0"
,
GetDeviceAllocator
(
device_type_
),
DT_FLOAT
);
net_
=
std
::
move
(
CreateNet
(
*
net_def
,
ws_
.
get
(),
device_type
));
net_
=
std
::
move
(
CreateNet
(
*
net_def
,
ws_
.
get
(),
device_type
));
}
}
MaceEngine
::~
MaceEngine
()
{
MaceEngine
::~
MaceEngine
(){}
}
const
float
*
MaceEngine
::
Run
(
const
float
*
input
,
const
float
*
MaceEngine
::
Run
(
const
float
*
input
,
const
std
::
vector
<
index_t
>
&
input_shape
,
const
std
::
vector
<
index_t
>
&
input_shape
,
std
::
vector
<
int64_t
>
&
output_shape
)
{
std
::
vector
<
int64_t
>
&
output_shape
)
{
...
...
mace/core/net.h
浏览文件 @
f291ce31
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#define MACE_CORE_NET_H_
#define MACE_CORE_NET_H_
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
...
...
mace/core/operator.h
浏览文件 @
f291ce31
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#include "mace/core/registry.h"
#include "mace/core/registry.h"
#include "mace/core/tensor.h"
#include "mace/core/tensor.h"
#include "mace/core/workspace.h"
#include "mace/core/workspace.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
...
...
mace/core/mace.h
→
mace/core/
public/
mace.h
浏览文件 @
f291ce31
文件已移动
mace/core/public/version.h
0 → 100644
浏览文件 @
f291ce31
//
// Copyright (c) 2017 XiaoMi All rights reserved.
//
#ifndef MACE_CORE_PUBLIC_VERSION_H_
#define MACE_CORE_PUBLIC_VERSION_H_
#define MACE_MAJOR_VERSION 0
#define MACE_MINOR_VERSION 1
#define MACE_PATCH_VERSION 0
// MACE_VERSION_SUFFIX is non-empty for pre-releases (e.g. "-alpha", "-alpha.1",
// "-beta", "-rc", "-rc.1")
#define MACE_VERSION_SUFFIX ""
#define MACE_STR_HELPER(x) #x
#define MACE_STR(x) MACE_STR_HELPER(x)
// e.g. "0.5.0" or "0.6.0-alpha".
#define MACE_VERSION_STRING \
(MACE_STR(MACE_MAJOR_VERSION) "." MACE_STR(MACE_MINOR_VERSION) "." MACE_STR( \
MACE_PATCH_VERSION) MACE_VERSION_SUFFIX)
extern
const
char
*
MaceVersion
();
extern
const
char
*
MaceGitVersion
();
#endif // MACE_CORE_PUBLIC_VERSION_H_
mace/core/serializer.h
浏览文件 @
f291ce31
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/core/tensor.h"
#include "mace/core/tensor.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
...
...
mace/core/tensor.h
浏览文件 @
f291ce31
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/utils/logging.h"
#include "mace/utils/logging.h"
#include "mace/core/types.h"
#include "mace/core/types.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
...
...
mace/core/types.h
浏览文件 @
f291ce31
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#define MACE_CORE_TYPES_H_
#define MACE_CORE_TYPES_H_
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
#include "mace/core/half.h"
#include "mace/core/half.h"
...
...
mace/core/workspace.h
浏览文件 @
f291ce31
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/core/tensor.h"
#include "mace/core/tensor.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
...
...
mace/examples/mace_run.cc
浏览文件 @
f291ce31
...
@@ -17,10 +17,12 @@
...
@@ -17,10 +17,12 @@
#include <iostream>
#include <iostream>
#include <cstdlib>
#include <cstdlib>
#include "mace/utils/command_line_flags.h"
#include "mace/utils/command_line_flags.h"
#include "mace/core/mace.h"
#include "mace/utils/logging.h"
#include "mace/utils/logging.h"
#include "mace/utils/env_time.h"
#include "mace/utils/env_time.h"
#include "mace/core/public/mace.h"
#include "mace/core/public/version.h"
using
namespace
std
;
using
namespace
std
;
using
namespace
mace
;
using
namespace
mace
;
...
@@ -82,7 +84,9 @@ int main(int argc, char **argv) {
...
@@ -82,7 +84,9 @@ int main(int argc, char **argv) {
return
-
1
;
return
-
1
;
}
}
VLOG
(
0
)
<<
"model: "
<<
model_file
<<
std
::
endl
VLOG
(
0
)
<<
"mace version: "
<<
MaceVersion
()
<<
std
::
endl
<<
"mace git version: "
<<
MaceGitVersion
()
<<
std
::
endl
<<
"model: "
<<
model_file
<<
std
::
endl
<<
"input: "
<<
input_node
<<
std
::
endl
<<
"input: "
<<
input_node
<<
std
::
endl
<<
"output: "
<<
output_node
<<
std
::
endl
<<
"output: "
<<
output_node
<<
std
::
endl
<<
"input_shape: "
<<
input_shape
<<
std
::
endl
<<
"input_shape: "
<<
input_shape
<<
std
::
endl
...
...
mace/kernels/batch_norm.h
浏览文件 @
f291ce31
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include "mace/core/future.h"
#include "mace/core/future.h"
#include "mace/core/tensor.h"
#include "mace/core/tensor.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
namespace
kernels
{
namespace
kernels
{
...
...
mace/kernels/bias_add.h
浏览文件 @
f291ce31
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include "mace/core/future.h"
#include "mace/core/future.h"
#include "mace/core/tensor.h"
#include "mace/core/tensor.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
namespace
kernels
{
namespace
kernels
{
...
...
mace/kernels/concat.h
浏览文件 @
f291ce31
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/core/future.h"
#include "mace/core/future.h"
#include "mace/core/types.h"
#include "mace/core/types.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
#include "mace/core/tensor.h"
#include "mace/core/tensor.h"
namespace
mace
{
namespace
mace
{
...
...
mace/kernels/depthwise_conv2d.h
浏览文件 @
f291ce31
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include "mace/core/future.h"
#include "mace/core/future.h"
#include "mace/core/common.h"
#include "mace/core/common.h"
#include "mace/kernels/conv_pool_2d_util.h"
#include "mace/kernels/conv_pool_2d_util.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
namespace
kernels
{
namespace
kernels
{
...
...
mace/kernels/space_to_batch.h
浏览文件 @
f291ce31
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include "mace/core/future.h"
#include "mace/core/future.h"
#include "mace/core/tensor.h"
#include "mace/core/tensor.h"
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace
mace
{
namespace
mace
{
namespace
kernels
{
namespace
kernels
{
...
...
mace/ops/concat.h
浏览文件 @
f291ce31
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include "mace/core/operator.h"
#include "mace/core/operator.h"
#include "mace/kernels/concat.h"
#include "mace/kernels/concat.h"
#include "mace/core/mace.h"
namespace
mace
{
namespace
mace
{
template
<
DeviceType
D
,
typename
T
>
template
<
DeviceType
D
,
typename
T
>
...
...
mace/python/tools/model.template
浏览文件 @
f291ce31
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
{% if mode == 0 %}
{% if mode == 0 %}
#include <vector>
#include <vector>
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace {{tag}}{
namespace {{tag}}{
...
@@ -24,7 +24,7 @@ void Create{{tensor.name}}(std::vector<mace::TensorProto> &tensors) {
...
@@ -24,7 +24,7 @@ void Create{{tensor.name}}(std::vector<mace::TensorProto> &tensors) {
{% elif mode == 1 %}
{% elif mode == 1 %}
#include <vector>
#include <vector>
#include <string>
#include <string>
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace {
namespace {
static void UpdateOp(mace::OperatorDef &op,
static void UpdateOp(mace::OperatorDef &op,
...
@@ -95,7 +95,7 @@ void CreateOperator{{i}}(mace::OperatorDef &op) {
...
@@ -95,7 +95,7 @@ void CreateOperator{{i}}(mace::OperatorDef &op) {
{% else %}
{% else %}
#include <vector>
#include <vector>
#include <string>
#include <string>
#include "mace/core/mace.h"
#include "mace/core/
public/
mace.h"
namespace {{tag}} {
namespace {{tag}} {
...
...
mace/tools/git/gen_version_source.sh
0 → 100644
浏览文件 @
f291ce31
#!/usr/bin/env bash
#
# Copyright (c) 2017 XiaoMi All rights reserved.
#
OUTPUT_FILENAME
=
$1
if
[[
-z
"
${
OUTPUT_FILENAME
}
}"
]]
;
then
echo
"Usage:
$0
<filename>"
exit
1
fi
GIT_VERSION
=
$(
git describe
--long
--tags
)
if
[[
$?
!=
0
]]
;
then
GIT_VERSION
=
unknown
fi
cat
<<
EOF
>
${
OUTPUT_FILENAME
}
#include "mace/core/public/version.h"
const char *MaceVersion() { return MACE_VERSION_STRING; }
const char *MaceGitVersion() { return "
${
GIT_VERSION
}
"; }
EOF
tools/validate_gcn.sh
浏览文件 @
f291ce31
...
@@ -27,6 +27,7 @@ CL_CODEGEN_DIR=${CODEGEN_DIR}/opencl
...
@@ -27,6 +27,7 @@ CL_CODEGEN_DIR=${CODEGEN_DIR}/opencl
CL_BIN_DIR
=
${
CODEGEN_DIR
}
/opencl_bin
CL_BIN_DIR
=
${
CODEGEN_DIR
}
/opencl_bin
TUNING_CODEGEN_DIR
=
${
CODEGEN_DIR
}
/tuning
TUNING_CODEGEN_DIR
=
${
CODEGEN_DIR
}
/tuning
TUNING_OR_NOT
=
${
3
:-
0
}
TUNING_OR_NOT
=
${
3
:-
0
}
VERSION_SOURCE_PATH
=
${
CODEGEN_DIR
}
/version
build_and_run
()
build_and_run
()
{
{
...
@@ -95,6 +96,11 @@ bazel-bin/mace/python/tools/tf_converter --input=${TF_MODEL_FILE_PATH} \
...
@@ -95,6 +96,11 @@ bazel-bin/mace/python/tools/tf_converter --input=${TF_MODEL_FILE_PATH} \
--model_tag
=
${
MODEL_TAG
}
\
--model_tag
=
${
MODEL_TAG
}
\
--confuse
=
True
--confuse
=
True
echo
"Step 3: Generate version source"
rm
-rf
${
VERSION_SOURCE_PATH
}
mkdir
-p
${
VERSION_SOURCE_PATH
}
bash mace/tools/git/gen_version_source.sh
${
VERSION_SOURCE_PATH
}
/version.cc
echo
"Step 3: Run model on the phone with files"
echo
"Step 3: Run model on the phone with files"
build_and_run
false
build_and_run
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录