Skip to content

Commit

Permalink
rely on iterator instead of operator[]
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyShuai committed Dec 15, 2023
1 parent cbad4fe commit 022ed57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions onnxruntime/core/framework/allocation_planner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,11 @@ class PlannerImpl {
std::function<void(NodeIndex)> dfs = [&](NodeIndex curr) {
if (dependents.find(curr) == dependents.end()) {
dependents.insert(curr);
for (NodeIndex dep : dependence_graph_[curr]) {
dfs(dep);
auto dep_graph_iter = dependence_graph_.find(curr);
if (dep_graph_iter != dependence_graph_.end()) {
for (NodeIndex dep : dep_graph_iter->second) {
dfs(dep);
}
}
}
};
Expand Down

0 comments on commit 022ed57

Please sign in to comment.