!881 Remove redundant process of keeping roots.

Merge pull request !881 from ZhangQinghua/master
pull/881/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit d436f798dc

@ -59,7 +59,7 @@ class Cloner {
// Map of replicate nodes and graphs
std::unordered_map<AnfNodePtr, AnfNodePtr> *cloned_node() { return &repl_node_; }
std::unordered_map<FuncGraphPtr, FuncGraphPtr> cloned_func_graph() { return repl_func_graph_; }
std::unordered_map<FuncGraphPtr, FuncGraphPtr> &cloned_func_graph() { return repl_func_graph_; }
// Scope of cloned graphs
void set_scope(const ScopePtr &scope) { scope_ = scope; }

@ -185,13 +185,6 @@ class Optimizer : public std::enable_shared_from_this<Optimizer> {
break;
}
}
auto keep_root = [&func_graph, this]() {
std::vector<FuncGraphPtr> func_graphs;
func_graphs.push_back(func_graph);
resource_->manager()->KeepRoots(func_graphs);
};
use_profile ? WITH(MsProfile::GetProfile()->Step("keep_roots")) keep_root : keep_root();
return func_graph;
}

Loading…
Cancel
Save