[inductor] Fix ModularIndexing assumptions (#152993)

Fixes https://github.com/pytorch/pytorch/issues/151198.

Since the result of ModularIndexing can be zero due to the modulo
operation, we should not make any assumption about ModularIndexing
being positive

Pull Request resolved: https://github.com/pytorch/pytorch/pull/152993
Approved by: https://github.com/yf225
This commit is contained in:
Isuru Fernando
2025-05-06 21:16:00 +00:00
committed by PyTorch MergeBot
parent d900c68ea6
commit e5f869999c
2 changed files with 7 additions and 4 deletions

View File

@ -363,10 +363,6 @@ class ModularIndexing(sympy.Function):
p, q = self.args[:2]
return fuzzy_eq(p.is_nonnegative, q.is_nonnegative) # type: ignore[attr-defined]
def _eval_is_positive(self) -> Optional[bool]:
p, q = self.args[:2]
return fuzzy_eq(p.is_positive, q.is_positive) # type: ignore[attr-defined]
class Where(sympy.Function):
"""