Remove redundant process of keeping roots.

pull/881/head
Zhang Qinghua 5 years ago
parent 3dd369cefa
commit 353cbc99ff

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

@ -185,13 +185,6 @@ class Optimizer : public std::enable_shared_from_this<Optimizer> {
break; 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; return func_graph;
} }

Loading…
Cancel
Save