Browse Source

Remove redundant process of keeping roots.

tags/v0.3.0-alpha
Zhang Qinghua 5 years ago
parent
commit
353cbc99ff
2 changed files with 1 additions and 8 deletions
  1. +1
    -1
      mindspore/ccsrc/ir/func_graph_cloner.h
  2. +0
    -7
      mindspore/ccsrc/optimizer/optimizer.h

+ 1
- 1
mindspore/ccsrc/ir/func_graph_cloner.h 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; }


+ 0
- 7
mindspore/ccsrc/optimizer/optimizer.h 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;
}



Loading…
Cancel
Save