We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5fdef1c commit b91c1c9Copy full SHA for b91c1c9
core/ir/ir.cpp
@@ -102,11 +102,8 @@ c10::optional<at::ScalarType> get_value_first_calc_dtype_opt(torch::jit::Block*
102
auto consumers = in->uses();
103
auto search_list = std::vector<torch::jit::Use>(consumers.begin(), consumers.end());
104
105
- while(search_list.size() > 0) {
106
- // after insertion, original iterator will be invalid
107
- auto& u = search_list.front();
108
- search_list.erase(search_list.begin());
109
- auto n = u.user;
+ for (auto iter = search_list.begin(); iter != search_list.end(); ++iter) {
+ auto n = iter->user;
110
LOG_GRAPH("Node we are looking at: " << util::node_info(n));
111
auto ins = n->inputs();
112
auto outs = n->outputs();
0 commit comments