Browse Source

Pre Merge pull request !570 from 陈华/development

pull/570/MERGE
陈华 Gitee 4 years ago
parent
commit
4fc5b99343
3 changed files with 26 additions and 14 deletions
  1. +1
    -0
      inc/framework/common/ge_types.h
  2. +24
    -13
      inc/framework/omg/parser/model_parser.h
  3. +1
    -1
      inc/framework/omg/parser/parser_inner_ctx.h

+ 1
- 0
inc/framework/common/ge_types.h View File

@@ -37,6 +37,7 @@ enum FrameworkType {
MINDSPORE = 1,
TENSORFLOW = 3,
ANDROID_NN,
ONNX,
FRAMEWORK_RESERVED,
};



+ 24
- 13
inc/framework/omg/parser/model_parser.h View File

@@ -54,18 +54,29 @@ 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;

/**
* @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
@@ -97,11 +108,11 @@ 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;


+ 1
- 1
inc/framework/omg/parser/parser_inner_ctx.h View File

@@ -59,7 +59,7 @@ struct ParserContext {
bool train_flag = false;
domi::domiTensorFormat_t format = domi::DOMI_TENSOR_ND;
domi::FrameworkType type = domi::FRAMEWORK_RESERVED;
RunMode run_mode = ONLY_PRE_CHECK;
RunMode run_mode = GEN_OM_MODEL;
// save caffe custom proto path, used by caffe parse
std::string custom_proto_path;
// save caffe proto path, used by caffe parse


Loading…
Cancel
Save