Make the max nanpropagation test more meaningful for integer types

This commit is contained in:
Joona Havukainen
2025-07-08 16:42:19 -07:00
parent 8b15773206
commit aca7fac9ef

View File

@@ -167,7 +167,7 @@ class TestReduce(mlx_tests.MLXTestCase):
for dtype in dtypes: for dtype in dtypes:
with self.subTest(dtype=dtype): with self.subTest(dtype=dtype):
x = (mx.random.normal((4, 4))).astype(getattr(mx, dtype)) x = (mx.random.normal((4, 4)) * 10).astype(getattr(mx, dtype))
indices = mx.random.randint(0, 4, shape=(6,)).reshape(3, 2) indices = mx.random.randint(0, 4, shape=(6,)).reshape(3, 2)
for idx in indices: for idx in indices:
x[*idx] = mx.nan x[*idx] = mx.nan