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

Method test_isclose

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

Source from the content-addressed store, hash-verified

1096 self.assertTrue(mx.allclose(c, c).item())
1097
1098 def test_isclose(self):
1099 a = mx.array([float("inf"), float("inf"), float("-inf")])
1100 b = mx.array([float("inf"), float("-inf"), float("-inf")])
1101
1102 self.assertListEqual(mx.isclose(a, b).tolist(), [True, False, True])
1103
1104 a = mx.array([np.nan])
1105 self.assertListEqual(mx.isclose(a, a).tolist(), [False])
1106
1107 a = mx.array([np.nan])
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]])

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected