Browse Source

add stage set

pull/251/head
wangxiaotian22 4 years ago
parent
commit
0bd3c202ca
2 changed files with 8 additions and 1 deletions
  1. +1
    -1
      metadef
  2. +7
    -0
      parser/tensorflow/tensorflow_parser.cc

+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit 3df578f6d08e51e2c4ed8a023fb8482109941665
Subproject commit 4f983b12aa972e9e89e1c212f4d4443aea00ef31

+ 7
- 0
parser/tensorflow/tensorflow_parser.cc View File

@@ -88,6 +88,7 @@ using ge::parser::ModelSaver;


namespace ge { namespace ge {
graphStatus aclgrphParseTensorFlow(const char *model_file, ge::Graph &graph) { graphStatus aclgrphParseTensorFlow(const char *model_file, ge::Graph &graph) {
ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kParser);
GE_CHECK_NOTNULL(model_file); GE_CHECK_NOTNULL(model_file);
GetParserContext().type = domi::TENSORFLOW; GetParserContext().type = domi::TENSORFLOW;
std::map<string, string> options; std::map<string, string> options;
@@ -127,6 +128,7 @@ graphStatus aclgrphParseTensorFlow(const char *model_file, ge::Graph &graph) {


graphStatus aclgrphParseTensorFlow(const char *model_file, const std::map<AscendString, AscendString> &parser_params, graphStatus aclgrphParseTensorFlow(const char *model_file, const std::map<AscendString, AscendString> &parser_params,
ge::Graph &graph) { ge::Graph &graph) {
ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kParser);
GE_CHECK_NOTNULL(model_file); GE_CHECK_NOTNULL(model_file);
GetParserContext().type = domi::TENSORFLOW; GetParserContext().type = domi::TENSORFLOW;
std::map<string, string> options; std::map<string, string> options;
@@ -1074,6 +1076,7 @@ Status TensorFlowModelParser::ExcuteScopeFusionPasses(domi::tensorflow::GraphDef
} }


Status TensorFlowModelParser::ParseFromMemory(const char *data, uint32_t size, ge::ComputeGraphPtr &graph) { Status TensorFlowModelParser::ParseFromMemory(const char *data, uint32_t size, ge::ComputeGraphPtr &graph) {
ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kParser);
GE_CHECK_NOTNULL(data); GE_CHECK_NOTNULL(data);
GE_CHECK_NOTNULL(graph); GE_CHECK_NOTNULL(graph);


@@ -1216,6 +1219,7 @@ Status TensorFlowModelParser::GetFunctionProto(const string &file,
} }


Status TensorFlowModelParser::Parse(const char *model_path, ge::Graph &graph) { Status TensorFlowModelParser::Parse(const char *model_path, ge::Graph &graph) {
ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kParser);
GE_CHECK_NOTNULL(model_path); GE_CHECK_NOTNULL(model_path);
ge::ComputeGraphPtr root_graph = ge::GraphUtils::GetComputeGraph(graph); ge::ComputeGraphPtr root_graph = ge::GraphUtils::GetComputeGraph(graph);
GE_CHECK_NOTNULL(root_graph); GE_CHECK_NOTNULL(root_graph);
@@ -1309,6 +1313,7 @@ Status TensorFlowModelParser::Parse(const char *model_path, ge::ComputeGraphPtr
} }


Status TensorFlowModelParser::ParseAllGraph(const google::protobuf::Message *proto, ge::ComputeGraphPtr &graph) { Status TensorFlowModelParser::ParseAllGraph(const google::protobuf::Message *proto, ge::ComputeGraphPtr &graph) {
ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kParser);
GE_CHECK_NOTNULL(proto); GE_CHECK_NOTNULL(proto);
GE_CHECK_NOTNULL(graph); GE_CHECK_NOTNULL(graph);


@@ -2141,6 +2146,7 @@ Status TensorFlowWeightsParser::ParseFromMemory(const char *data, uint32_t size,
Status TensorFlowWeightsParser::Parse(const char *file, ge::Graph &graph) { return SUCCESS; } Status TensorFlowWeightsParser::Parse(const char *file, ge::Graph &graph) { return SUCCESS; }


Status TensorFlowModelParser::ParseProto(const google::protobuf::Message *proto, ge::ComputeGraphPtr &graph) { Status TensorFlowModelParser::ParseProto(const google::protobuf::Message *proto, ge::ComputeGraphPtr &graph) {
ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kParser);
ErrorManager::GetInstance().GenWorkStreamIdDefault(); ErrorManager::GetInstance().GenWorkStreamIdDefault();
PARSER_TIMESTAMP_START(ParseProto); PARSER_TIMESTAMP_START(ParseProto);
GE_CHECK_NOTNULL(proto); GE_CHECK_NOTNULL(proto);
@@ -2268,6 +2274,7 @@ Status TensorFlowModelParser::ParseProto(const google::protobuf::Message *proto,


Status TensorFlowModelParser::ParseProtoWithSubgraph(const google::protobuf::Message *root_proto, Status TensorFlowModelParser::ParseProtoWithSubgraph(const google::protobuf::Message *root_proto,
domi::GetGraphCallback callback, ge::ComputeGraphPtr &root_graph) { domi::GetGraphCallback callback, ge::ComputeGraphPtr &root_graph) {
ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kParser);
ErrorManager::GetInstance().GenWorkStreamIdDefault(); ErrorManager::GetInstance().GenWorkStreamIdDefault();
GE_CHECK_NOTNULL(root_proto); GE_CHECK_NOTNULL(root_proto);
GE_CHECK_NOTNULL(callback); GE_CHECK_NOTNULL(callback);


Loading…
Cancel
Save