Browse Source

Pre Merge pull request !1110 from zhaoxinxin/development

pull/1110/MERGE
zhaoxinxin Gitee 5 years ago
parent
commit
49ec2ab661
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      ge/graph/passes/no_use_reshape_remove_pass.cc

+ 9
- 4
ge/graph/passes/no_use_reshape_remove_pass.cc View File

@@ -83,11 +83,16 @@ Status NoUseReshapeRemovePass::Run(ge::NodePtr &node) {
}
if (to_be_deleted) {
GELOGI("NoUseReshapeRemovePass remove useless node:%s", node->GetName().c_str());
auto ret = PassUtils::UnlinkNodeWithControlCopy(node, kReshapeShapeIndex);
if (ret != SUCCESS) {
GELOGE(ret, "DimensionAdjustPass unlink node with control copy fail.");
return ret;
// if shape input without any input(const), it can be unlink from reshape
auto shape_input_anchor = node->GetInDataAnchor(kReshapeShapeIndex);
if (shape_input_anchor != nullptr) {
auto shape_input = shape_input_anchor->GetOwnerNode();
GE_CHECK_NOTNULL(shape_input);
if (shape_input->GetInAllNodes().empty()) {
shape_input_anchor->UnlinkAll();
}
}

return IsolateAndDeleteNode(node, {kReshapeDataIndex});
}
return SUCCESS;


Loading…
Cancel
Save