Browse Source

Description:Support model_exit in GE

Team:HISI_SW
Feature or Bugfix:Feature
pull/63/head
l00444296 5 years ago
parent
commit
6bd594e149
2 changed files with 10 additions and 10 deletions
  1. +7
    -7
      parser/common/acl_graph_parser_util.cc
  2. +3
    -3
      parser/common/acl_graph_parser_util.h

+ 7
- 7
parser/common/acl_graph_parser_util.cc View File

@@ -216,7 +216,7 @@ static Status CheckOutNode(ge::OpDescPtr op_desc, int32_t index) {
}

domi::Status VerifyOutputTypeAndOutNodes(std::vector<std::string> &out_type_vec) {
std::vector<std::pair<std::string, int32_t>> user_out_nodes = domi::GetContext().user_out_nodes;
std::vector<std::pair<std::string, int32_t>> user_out_nodes = ge::GetParserContext().user_out_nodes;
std::set<std::string> out_nodes_info;
for (uint32_t i = 0; i < user_out_nodes.size(); ++i) {
// out_nodes set should include output_type and output_format
@@ -594,8 +594,8 @@ void AclGrphParseUtil::AddAttrsForInputNodes(const vector<string> &adjust_fp16_f
}

domi::Status AclGrphParseUtil::ParseAclInputFp16Nodes(const ComputeGraphPtr &graph,
const string &input_fp16_nodes,
const string &is_input_adjust_hw_layout) {
const string &input_fp16_nodes,
const string &is_input_adjust_hw_layout) {
GE_CHECK_NOTNULL(graph);
vector<string> adjust_fp16_format_vec;
if (!is_input_adjust_hw_layout.empty()) {
@@ -725,9 +725,9 @@ domi::Status AclGrphParseUtil::ParseAclOutputType(const std::string &output_type
}

void AclGrphParseUtil::GetOutputNodesNameAndIndex(std::vector<std::pair<ge::NodePtr, int32_t>> &output_nodes_info,
std::vector<std::string> &output_nodes_name) {
std::vector<std::string> &output_nodes_name) {
output_nodes_name.clear();
if (domi::GetContext().out_top_names.empty()) {
if (ge::GetParserContext().out_top_names.empty()) {
// tf process, no top name.
for (const auto output_node_info : output_nodes_info) {
std::string node_name = output_node_info.first->GetName();
@@ -740,8 +740,8 @@ void AclGrphParseUtil::GetOutputNodesNameAndIndex(std::vector<std::pair<ge::Node
for (size_t i = 0; i < output_nodes_info.size(); ++i) {
std::string node_name = output_nodes_info[i].first->GetName();
int32_t index = output_nodes_info[i].second;
if (i < domi::GetContext().out_top_names.size()) {
output_nodes_name.push_back(node_name + ":" + std::to_string(index) + ":" + domi::GetContext().out_top_names[i]);
if (i < ge::GetParserContext().out_top_names.size()) {
output_nodes_name.push_back(node_name + ":" + std::to_string(index) + ":" + ge::GetParserContext().out_top_names[i]);
} else {
GELOGW("Get top name of node [%s] fail.", node_name.c_str());
output_nodes_name.push_back(node_name + ":" + std::to_string(index));


+ 3
- 3
parser/common/acl_graph_parser_util.h View File

@@ -44,7 +44,7 @@ class AclGrphParseUtil {
domi::Status ParseParamsBeforeGraph(const std::map<std::string, std::string> &parser_params,
std::string &graph_name);
domi::Status ParseParamsAfterGraph(ge::Graph &graph,
const std::map<std::string, std::string> &parser_params);
const std::map<std::string, std::string> &parser_params);
domi::Status ParseOutputInfo(ge::Graph &graph,
const std::map<std::string, std::string> &parser_params);
private:
@@ -68,8 +68,8 @@ class AclGrphParseUtil {
const string &fp16_nodes_name, uint32_t index,
OpDescPtr &op_desc);
domi::Status ParseAclInputFp16Nodes(const ComputeGraphPtr &graph,
const string &input_fp16_nodes,
const string &is_input_adjust_hw_layout);
const string &input_fp16_nodes,
const string &is_input_adjust_hw_layout);
domi::Status ParseAclWeightCompressConf(const ComputeGraphPtr &graph,
const string &compress_weight_conf);
domi::Status ParseAclOutputType(const std::string &output_type,


Loading…
Cancel
Save