| @@ -84,10 +84,10 @@ NodePtr AddConstNodeToGraph(GeTensorPtr &tensor, ComputeGraphPtr &graph) { | |||||
| } | } | ||||
| GE_IF_BOOL_EXEC(graph == nullptr, GELOGW("input param graph is null"); return nullptr); | GE_IF_BOOL_EXEC(graph == nullptr, GELOGW("input param graph is null"); return nullptr); | ||||
| (void) AttrUtils::SetListStr(const_desc, ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, std::move(std::vector<std::string>())); | |||||
| return graph->AddNodeFront(const_desc); | return graph->AddNodeFront(const_desc); | ||||
| } | } | ||||
| NodePtr AddIdentityNodeToGraph(const std::string &name, const GeTensorDesc &tensor, ComputeGraphPtr &graph) { | NodePtr AddIdentityNodeToGraph(const std::string &name, const GeTensorDesc &tensor, ComputeGraphPtr &graph) { | ||||
| if (graph == nullptr) { | if (graph == nullptr) { | ||||
| GELOGE(INTERNAL_ERROR, "Compute graph ptr is null in creating identity node."); | GELOGE(INTERNAL_ERROR, "Compute graph ptr is null in creating identity node."); | ||||
| @@ -238,6 +238,14 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho | |||||
| node->GetName().c_str(), index); | node->GetName().c_str(), index); | ||||
| return INTERNAL_ERROR; | return INTERNAL_ERROR; | ||||
| } | } | ||||
| vector<string> curr_origin_op_names; | |||||
| (void)AttrUtils::GetListStr(node->GetOpDesc(), curr_origin_op_names); | |||||
| if (curr_origin_op_names.empty()) { | |||||
| (void)AttrUtils::SetListStr(const_desc, ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, std::move({node->GetName()})); | |||||
| } else { | |||||
| (void)AttrUtils::SetListStr(const_desc, ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, curr_origin_op_names); | |||||
| } | |||||
| GELOGI("add const_node:%s, replace node %s, type %s, index %zu.", const_node->GetName().c_str(), | GELOGI("add const_node:%s, replace node %s, type %s, index %zu.", const_node->GetName().c_str(), | ||||
| node->GetName().c_str(), node->GetType().c_str(), index); | node->GetName().c_str(), node->GetType().c_str(), index); | ||||
| // add new const to re-pass node | // add new const to re-pass node | ||||