Browse Source

modified: ge/graph/passes/folding_pass.cc

pull/614/head
zhaoxinxin 5 years ago
parent
commit
6a4bb0e773
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      ge/graph/passes/folding_pass.cc

+ 5
- 3
ge/graph/passes/folding_pass.cc View File

@@ -84,7 +84,6 @@ 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);
} }


@@ -173,7 +172,10 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) {
continue; continue;
} }
auto in_node = in_node_anchor->GetOwnerNode(); 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()); 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); auto ret = in_node_anchor->Unlink(in_data_anchor);
if (ret != SUCCESS) { if (ret != SUCCESS) {
@@ -185,7 +187,7 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) {
node->GetName().c_str()); node->GetName().c_str());
auto identity_name = node->GetName() + "_ctrl_identity_" + std::to_string(in_data_anchor->GetIdx()); auto identity_name = node->GetName() + "_ctrl_identity_" + std::to_string(in_data_anchor->GetIdx());
auto identity = 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) { if (identity == nullptr) {
GELOGE(INTERNAL_ERROR, "Failed to add identity node to graph."); GELOGE(INTERNAL_ERROR, "Failed to add identity node to graph.");
return INTERNAL_ERROR; return INTERNAL_ERROR;


Loading…
Cancel
Save