Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
65c9d0d3
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,发现更多精彩内容 >>
提交
65c9d0d3
编写于
8月 03, 2018
作者:
李
李寅
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'add-comment' into 'master'
Add comments for some APIs. See merge request !708
上级
837f74b1
7aba2972
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
2 deletion
+32
-2
mace/examples/cli/example.cc
mace/examples/cli/example.cc
+4
-2
mace/public/mace.h
mace/public/mace.h
+13
-0
mace/python/tools/mace_engine_factory.h.jinja2
mace/python/tools/mace_engine_factory.h.jinja2
+15
-0
未找到文件。
mace/examples/cli/example.cc
浏览文件 @
65c9d0d3
...
...
@@ -113,7 +113,7 @@ DEFINE_string(opencl_parameter_file,
"tuned OpenCL parameter file path"
);
DEFINE_string
(
model_data_file
,
""
,
"model data file name, used when
EMBED_MODEL_DATA set to 0
"
);
"model data file name, used when
model_data_format == file
"
);
DEFINE_string
(
model_file
,
""
,
"model file name, used when load mace model in pb"
);
...
...
@@ -194,9 +194,11 @@ bool RunModel(const std::vector<std::string> &input_names,
// Create Engine
std
::
shared_ptr
<
mace
::
MaceEngine
>
engine
;
MaceStatus
create_engine_status
;
// Only choose one of the two type based on the `
build_type
`
// Only choose one of the two type based on the `
model_graph_format
`
// in model deployment file(.yml).
#ifdef MODEL_GRAPH_FORMAT_CODE
// if model_data_format == code, just pass an empty string("")
// to model_data_file parameter.
create_engine_status
=
CreateMaceEngineFromCode
(
FLAGS_model_name
,
FLAGS_model_data_file
,
...
...
mace/public/mace.h
浏览文件 @
65c9d0d3
...
...
@@ -127,6 +127,19 @@ class __attribute__((visibility("default"))) MaceEngine {
MaceEngine
&
operator
=
(
const
MaceEngine
&
)
=
delete
;
};
/// \brief Create MaceEngine from files (model file + data file)
///
/// Create MaceEngine object
///
/// \param model_pb[in]: the content of model graph file
/// \param model_data_file[in]: the path of model data file
/// \param input_nodes[in]: the array of input nodes' name
/// \param output_nodes[in]: the array of output nodes' name
/// \param device_type[in]: one of [CPU, GPU, HEXAGON],
/// based on the runtime type of your model deployment file.
/// \param engine[out]: output MaceEngine object
/// \return MACE_SUCCESS for success, MACE_INVALID_ARGS for wrong arguments,
/// MACE_OUT_OF_RESOURCES for resources is out of range.
__attribute__
((
visibility
(
"default"
)))
MaceStatus
CreateMaceEngineFromProto
(
const
std
::
vector
<
unsigned
char
>
&
model_pb
,
...
...
mace/python/tools/mace_engine_factory.h.jinja2
浏览文件 @
65c9d0d3
...
...
@@ -47,6 +47,21 @@ std::map<std::string, int> model_name_map {
};
} // namespace
/// \brief Create MaceEngine from code
///
/// Create MaceEngine object based on model graph code and model data file or
/// model data code.
///
/// \param model_name[in]: the name of model you want to use.
/// \param model_data_file[in]: the path of model data file,
/// if model_data_format is code, just pass empty string("")
/// \param input_nodes[in]: the array of input nodes' name
/// \param output_nodes[in]: the array of output nodes' name
/// \param device_type[in]: one of [CPU, GPU, HEXAGON],
/// based on the runtime type of your model deployment file.
/// \param engine[out]: output MaceEngine object
/// \return MACE_SUCCESS for success, MACE_INVALID_ARGS for wrong arguments,
/// MACE_OUT_OF_RESOURCES for resources is out of range.
MaceStatus CreateMaceEngineFromCode(
const std::string &model_name,
const std::string &model_data_file,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录