File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
torch/csrc/jit/codegen/cuda Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,6 @@ struct ConstCheck : OptOutConstDispatch {
69
69
is_const_ = is_const_ && false ;
70
70
}
71
71
72
- void handle (const NamedScalar* const ns) override {
73
- is_const_ = is_const_ && false ;
74
- }
75
-
76
72
void handle (const Expr* const expr) override {
77
73
for (auto inp : expr->inputs ()) {
78
74
OptOutConstDispatch::handle (inp);
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ void IterVisitor::traverseFrom(
56
56
FusionGuard fg (fusion);
57
57
std::unordered_set<Statement*> visited;
58
58
stmt_stack.clear ();
59
- stmt_stack.emplace_back (from.rbegin (), from.rend ());
59
+ if (!from.empty ())
60
+ stmt_stack.emplace_back (from.rbegin (), from.rend ());
60
61
61
62
while (!stmt_stack.empty ()) {
62
63
auto next_stmts = next (stmt_stack.back ().back ());
@@ -186,10 +187,12 @@ std::unordered_set<Val*> IterVisitor::getTerminatingOutputs(
186
187
FusionGuard fg (fusion);
187
188
188
189
std::unordered_set<Val*> used_vals;
189
- for (auto expr : Exprs::getExprs (
190
- fusion,
191
- std::vector<Val*>(
192
- fusion->outputs ().begin (), fusion->outputs ().end ()))) {
190
+
191
+ auto exprs = Exprs::getExprs (
192
+ fusion,
193
+ std::vector<Val*>(fusion->outputs ().begin (), fusion->outputs ().end ()));
194
+
195
+ for (auto expr : exprs) {
193
196
for (auto inp : expr->inputs ())
194
197
used_vals.emplace (inp);
195
198
}
You can’t perform that action at this time.
0 commit comments