提交 7aba2972 编写于 作者: L liuqi

Add comments for some APIs.

上级 837f74b1
......@@ -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,
......
......@@ -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,
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册