mirror of
				https://github.com/pytorch/pytorch.git
				synced 2025-11-04 08:00:58 +08:00 
			
		
		
		
	[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:
		
				
					committed by
					
						
						PyTorch MergeBot
					
				
			
			
				
	
			
			
			
						parent
						
							d900c68ea6
						
					
				
				
					commit
					e5f869999c
				
			@ -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):
 | 
			
		||||
    """
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user