Browse Source

add onnx model parse api

pull/134/head
baker 5 years ago
parent
commit
b7a40262ae
2 changed files with 5 additions and 5 deletions
  1. +3
    -3
      inc/external/parser/onnx_parser.h
  2. +2
    -2
      parser/onnx/onnx_parser.cc

+ 3
- 3
inc/external/parser/onnx_parser.h View File

@@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */


#ifndef INC_EXTERNAL_ACL_GRAPH_ONNX_H_
#define INC_EXTERNAL_ACL_GRAPH_ONNX_H_
#ifndef INC_EXTERNAL_PARSER_ONNX_PARSER_H_
#define INC_EXTERNAL_PARSER_ONNX_PARSER_H_


#include "graph/ascend_string.h" #include "graph/ascend_string.h"
#include "graph/ge_error_codes.h" #include "graph/ge_error_codes.h"
@@ -30,4 +30,4 @@ graphStatus aclgrphParseONNXFromMem(const char *buffer, size_t size,
const std::map<ge::AscendString, ge::AscendString> &parser_params, ge::Graph &graph); const std::map<ge::AscendString, ge::AscendString> &parser_params, ge::Graph &graph);
} // namespace ge } // namespace ge


#endif // INC_EXTERNAL_ACL_GRAPH_ONNX_H_
#endif // INC_EXTERNAL_PARSER_ONNX_PARSER_H_

+ 2
- 2
parser/onnx/onnx_parser.cc View File

@@ -85,7 +85,7 @@ graphStatus aclgrphParseONNX(const char *model_file,
AclGrphParseUtil acl_graph_parse_util; AclGrphParseUtil acl_graph_parse_util;
std::shared_ptr<domi::ModelParser> model_parser; std::shared_ptr<domi::ModelParser> model_parser;


if (PrepareBeforeParse(acl_graph_parse_util, parser_params, graph, model_parser) != ge::SUCCESS) {
if (PrepareBeforeParse(acl_graph_parse_util, parser_params, graph, model_parser) != ge::SUCCESS) {
GELOGE(ge::FAILED, "prepare before parse failed."); GELOGE(ge::FAILED, "prepare before parse failed.");
return ge::FAILED; return ge::FAILED;
} }
@@ -99,7 +99,7 @@ graphStatus aclgrphParseONNX(const char *model_file,
} }
GELOGI("Parser graph %s success.", graph.GetName().c_str()); GELOGI("Parser graph %s success.", graph.GetName().c_str());


if (HandleAfterParse(acl_graph_parse_util, parser_params, graph) != ge::SUCCESS) {
if (HandleAfterParse(acl_graph_parse_util, parser_params, graph) != ge::SUCCESS) {
GELOGE(ge::FAILED, "handle after parse failed."); GELOGE(ge::FAILED, "handle after parse failed.");
return ge::FAILED; return ge::FAILED;
} }


Loading…
Cancel
Save