MCPcopy Create free account
hub / github.com/ml-explore/mlx / test_all

Method test_all

python/tests/test_ops.py:1110–1119  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1108 self.assertListEqual(mx.isclose(a, a, equal_nan=True).tolist(), [True])
1109
1110 def test_all(self):
1111 a = mx.array([[True, False], [True, True]])
1112
1113 self.assertFalse(mx.all(a).item())
1114 self.assertEqual(mx.all(a, keepdims=True).shape, (1, 1))
1115 self.assertFalse(mx.all(a, axis=[0, 1]).item())
1116 self.assertEqual(mx.all(a, axis=[0]).tolist(), [True, False])
1117 self.assertEqual(mx.all(a, axis=[1]).tolist(), [False, True])
1118 self.assertEqual(mx.all(a, axis=0).tolist(), [True, False])
1119 self.assertEqual(mx.all(a, axis=1).tolist(), [False, True])
1120
1121 def test_any(self):
1122 a = mx.array([[True, False], [False, False]])

Callers

nothing calls this directly

Calls 2

itemMethod · 0.80
arrayMethod · 0.60

Tested by

no test coverage detected