Skip to content

Commit

Permalink
[autodiff] Fix nullptr during adjoint codegen (#4771)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-ye authored Apr 12, 2022
1 parent a995a91 commit e675ddc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions taichi/transforms/auto_diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ class MakeAdjoint : public IRVisitor {
// for _ in range(5)
// q += a[i]
if (stmt->is<GlobalLoadStmt>() &&
(stmt->parent->parent_stmt != nullptr) &&
stmt->parent->parent_stmt->is<RangeForStmt>()) {
// Check whether this GlobalLoadStmt is in the body of a for-loop by
// searching in the backup forward pass If not (Case 1), the alloca
Expand Down

0 comments on commit e675ddc

Please sign in to comment.