Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in get_update_constraint #125194

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions torch/export/exported_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,15 +823,15 @@ def get_shape_env(gm):

fake_mode = detect_fake_mode(vals)
if fake_mode is not None:
return fake_mode.shape_env, fake_mode
return fake_mode.shape_env
for v in vals:
if isinstance(v, torch.SymInt):
return v.node.shape_env, fake_mode
return v.node.shape_env

# FIXME(tmanlaibaatar) Remove this whole branch once https://github.com/pytorch/pytorch/pull/123764
if _is_executorch:
assert old_range_constraints is None
shape_env, _ = get_shape_env(gm)
shape_env = get_shape_env(gm)
if shape_env is None:
return {}
range_constraints = {
Expand All @@ -849,7 +849,7 @@ def get_shape_env(gm):

assert old_range_constraints is not None

shape_env, fake_mode = get_shape_env(gm)
shape_env = get_shape_env(gm)
if shape_env is None:
return {}

Expand Down