[dynamic shapes] fix _maybe_evaluate_static axioms bug (#158672)

Summary: couldn't get a minimal repro, but xref for size change during dict iteration error: https://fb.workplace.com/groups/1075192433118967/posts/1709439696360901

Test Plan:
-

Rollback Plan:

Differential Revision: D78047846

Pull Request resolved: https://github.com/pytorch/pytorch/pull/158672
Approved by: https://github.com/bobrenjc93
This commit is contained in:
Pian Pawakapan
2025-07-21 23:14:19 +00:00
committed by PyTorch MergeBot
parent 2bb684304d
commit 1227ed6674

View File

@ -6263,7 +6263,7 @@ class ShapeEnv:
return
self._resimplify_floor_div_axioms = False
new_items = {}
for k, v in axioms.items():
for k, v in list(axioms.items()):
# A FloorDiv in implications could have became CleanDiv at this point, due to new facts
# to the shapeEnv. This handles such issue but its not ideal. This is the only expression
# simplification that depends on the global state of shape env.