skip modulo by zero in test_dtype_alu (#16404)

This commit is contained in:
Christopher Milan
2026-05-27 14:09:05 -07:00
committed by GitHub
parent 452c7d4230
commit 171401e8df

View File

@@ -111,6 +111,7 @@ def universal_test_cast(a, in_dtype, dtype):
def universal_test_midcast(a, b, c, op1, op2, d1:DType, d2:DType):
if not isinstance(op1, tuple): op1 = (op1, op1)
if not isinstance(op2, tuple): op2 = (op2, op2)
if op1[0] == operator.mod and b == 0: return
# lt and max with nan is undefined in tinygrad
if op1[0] in (operator.lt, Tensor.maximum) and (math.isnan(a) or math.isnan(b)): return
if op2[0] in (operator.lt, Tensor.maximum) and math.isnan(c): return