Skip to content

Commit ddac8da

Browse files
suofacebook-github-bot
authored andcommitted
avoid calling front() on empty working set (#21396)
Summary: Pull Request resolved: #21396 ghimport-source-id: 7e57282099d2fd57c58c990b51ae933e427aecb2 Reviewed By: jamesr66a Differential Revision: D15642663 Pulled By: suo fbshipit-source-id: f9b467ba53f03438879bf3929da522aabaff2343
1 parent bb1dbdb commit ddac8da

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

torch/csrc/jit/passes/alias_analysis.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,9 @@ class AliasDb::WorkingSet {
865865

866866
private:
867867
bool hasDataDependency(Node* n) const {
868+
if (!mover_ && nodes_.empty()) {
869+
return false;
870+
}
868871
const Node* pivot = mover_ ? mover_ : nodes_.front();
869872
if (n->isAfter(pivot)) {
870873
return producesFor(n);

0 commit comments

Comments
 (0)