Skip to content

Commit b69006c

Browse files
committed
Minor bug fixes.
1 parent 1f13213 commit b69006c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

torch/csrc/jit/codegen/cuda/ir_base_nodes.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ struct ConstCheck : OptOutConstDispatch {
6969
is_const_ = is_const_ && false;
7070
}
7171

72-
void handle(const NamedScalar* const ns) override {
73-
is_const_ = is_const_ && false;
74-
}
75-
7672
void handle(const Expr* const expr) override {
7773
for (auto inp : expr->inputs()) {
7874
OptOutConstDispatch::handle(inp);

torch/csrc/jit/codegen/cuda/iter_visitor.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ void IterVisitor::traverseFrom(
5656
FusionGuard fg(fusion);
5757
std::unordered_set<Statement*> visited;
5858
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());
6061

6162
while (!stmt_stack.empty()) {
6263
auto next_stmts = next(stmt_stack.back().back());
@@ -186,10 +187,12 @@ std::unordered_set<Val*> IterVisitor::getTerminatingOutputs(
186187
FusionGuard fg(fusion);
187188

188189
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) {
193196
for (auto inp : expr->inputs())
194197
used_vals.emplace(inp);
195198
}

0 commit comments

Comments
 (0)