!881 Remove redundant process of keeping roots.

Merge pull request !881 from ZhangQinghua/master
This commit is contained in:
mindspore-ci-bot 2020-04-30 14:35:22 +08:00 committed by Gitee
commit d436f798dc
2 changed files with 1 additions and 8 deletions

View File

@ -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; }

View File

@ -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;
}