From 93600779f7beedbeeaaf9f53c42c8f58e34ccab8 Mon Sep 17 00:00:00 2001 From: baker Date: Thu, 10 Dec 2020 11:38:11 +0800 Subject: [PATCH 1/3] add onnx model parse api --- inc/framework/omg/parser/model_parser.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inc/framework/omg/parser/model_parser.h b/inc/framework/omg/parser/model_parser.h index 20bfcef4..201b12d8 100644 --- a/inc/framework/omg/parser/model_parser.h +++ b/inc/framework/omg/parser/model_parser.h @@ -66,6 +66,17 @@ class ModelParser { /** * @ingroup domi_omg + * @brief Parse relevant data from memory and save it to graph + * @param [in] input Model file memory data and size + * @param [in|out] graph A graph for saving the model information after analysis + * @return SUCCESS + * @return FAILED + * @author + */ + virtual Status ParseFromMemory(const char *data, uint32_t size, ge::Graph &graph) = 0; + + /** + * @ingroup domi_omg * @brief Analyze network model data * @param [in] proto network model * @param [in|out] graph Save the network information after analysis From 7b3b650b95dd8c64dff4dd694d25e037189ea386 Mon Sep 17 00:00:00 2001 From: baker Date: Thu, 10 Dec 2020 14:19:15 +0800 Subject: [PATCH 2/3] add onnx model parse api --- inc/framework/omg/parser/model_parser.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/inc/framework/omg/parser/model_parser.h b/inc/framework/omg/parser/model_parser.h index 201b12d8..f995f8fa 100644 --- a/inc/framework/omg/parser/model_parser.h +++ b/inc/framework/omg/parser/model_parser.h @@ -54,14 +54,14 @@ class ModelParser { virtual Status Parse(const char *file, ge::Graph &graph) = 0; /** - * @ingroup domi_omg - * @brief Parse relevant data from memory and save it to graph - * @param [in] input Model file memory data - * @param [in|out] graph A graph for saving the model information after analysis - * @return SUCCESS - * @return FAILED - * @author - */ + * @ingroup domi_omg + * @brief Parse relevant data from memory and save it to graph + * @param [in] input Model file memory data + * @param [in|out] graph A graph for saving the model information after analysis + * @return SUCCESS + * @return FAILED + * @author + */ virtual Status ParseFromMemory(const char *data, uint32_t size, ge::ComputeGraphPtr &graph) = 0; /** @@ -107,12 +107,12 @@ class ModelParser { */ virtual Status ToJson(const char *model_file, const char *json_file) { return domi::SUCCESS; } - /* - * @ingroup domi_omg - * @brief Convert network data type - * @param [in] type Data type to be converted - * @return ge::DataType - */ + /** + * @ingroup domi_omg + * @brief Convert network data type + * @param [in] type Data type to be converted + * @return ge::DataType + */ virtual ge::DataType ConvertToGeDataType(const uint32_t type) = 0; virtual Status ParseAllGraph(const google::protobuf::Message *root_proto, ge::ComputeGraphPtr &root_graph) = 0; From 3851d898e7a0dae99fa0fd95ff69e13a82f1c72c Mon Sep 17 00:00:00 2001 From: baker Date: Thu, 10 Dec 2020 14:24:27 +0800 Subject: [PATCH 3/3] add onnx model parse api --- inc/framework/omg/parser/model_parser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/framework/omg/parser/model_parser.h b/inc/framework/omg/parser/model_parser.h index f995f8fa..5d0f3f5c 100644 --- a/inc/framework/omg/parser/model_parser.h +++ b/inc/framework/omg/parser/model_parser.h @@ -112,7 +112,7 @@ class ModelParser { * @brief Convert network data type * @param [in] type Data type to be converted * @return ge::DataType - */ + */ virtual ge::DataType ConvertToGeDataType(const uint32_t type) = 0; virtual Status ParseAllGraph(const google::protobuf::Message *root_proto, ge::ComputeGraphPtr &root_graph) = 0;