|
|
|
@@ -84,7 +84,6 @@ NodePtr AddConstNodeToGraph(GeTensorPtr &tensor, ComputeGraphPtr &graph) { |
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -173,7 +172,10 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
auto in_node = in_node_anchor->GetOwnerNode(); |
|
|
|
if ((in_node->GetType() == SWITCH) || (in_node->GetType() == REFSWITCH) || (in_node->GetType() == SWITCHN)) { |
|
|
|
if (in_node == nullptr) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if ((in_node->GetType() == SWITCH) || (in_node->GetType() == REFSWITCH)) { |
|
|
|
GELOGI("The in_node name is %s, and node type is %s.", in_node->GetName().c_str(), in_node->GetType().c_str()); |
|
|
|
auto ret = in_node_anchor->Unlink(in_data_anchor); |
|
|
|
if (ret != SUCCESS) { |
|
|
|
@@ -185,7 +187,7 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { |
|
|
|
node->GetName().c_str()); |
|
|
|
auto identity_name = node->GetName() + "_ctrl_identity_" + std::to_string(in_data_anchor->GetIdx()); |
|
|
|
auto identity = |
|
|
|
AddIdentityNodeToGraph(identity_name, node->GetOpDesc()->GetInputDesc(in_data_anchor->GetIdx()), graph); |
|
|
|
AddIdentityNodeToGraph(identity_name, node->GetOpDesc()->GetInputDesc(in_data_anchor->GetIdx()), graph); |
|
|
|
if (identity == nullptr) { |
|
|
|
GELOGE(INTERNAL_ERROR, "Failed to add identity node to graph."); |
|
|
|
return INTERNAL_ERROR; |
|
|
|
|