Skip to content

Commit

Permalink
[symbolic shapes] if symbol not in var_to_range default to unknown ra…
Browse files Browse the repository at this point in the history
…nge (pytorch#127681)

Summary:

Issue: pytorch#127677

Test Plan:
ci

---

Differential Revision: D58048558
  • Loading branch information
ColinPeppler authored and facebook-github-bot committed Jun 1, 2024
1 parent edffb28 commit 1ea316e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion torch/fx/experimental/symbolic_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4411,7 +4411,11 @@ def _maybe_evaluate_static(
# Skip var_ranges logic for SingletonInt which is only used
# for jagged layout NestedTensors today
continue
vr = var_ranges[k]
try:
vr = self.var_to_range[k]
except KeyError:
log.warning("%s is not in var_to_range, defaulting to unknown range.", k)
vr = self._default_unspecified_value_range()
if size_oblivious and k in self.size_like:
lower = max(2, vr.lower)
else:
Expand Down

0 comments on commit 1ea316e

Please sign in to comment.