“20d68051f4507a681654c401e7e79f8c8869b58d”上不存在“mobile/test/net/test_genet_combine.cpp”
提交 8218d82b 编写于 作者: L liuqi

Add model header template and move all generated file to same place.

上级 a3948a43
//
// Copyright (c) 2017 XiaoMi All rights reserved.
// Generated by the mace converter. DO NOT EDIT!
//
#include <string>
#include "mace/public/mace.h"
namespace mace {
namespace {{tag}} {
extern const unsigned char *LoadModelData(const char *model_data_file);
extern void UnloadModelData(const unsigned char *model_data);
extern NetDef CreateNet(const unsigned char *model_data);
extern const std::string ModelChecksum();
} // namespace {{ tag }}
} // namespace mace
......@@ -177,3 +177,11 @@ def convert_to_source(net_def, mode_pb_checksum, template_dir, obfuscate, model_
)
with open(output, "wb") as f:
f.write(source)
# generate model header file
template_name = 'model_header.template'
source = j2_env.get_template(template_name).render(
tag = model_tag,
)
with open(output_dir + model_tag + '.h', "wb") as f:
f.write(source)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册