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

Method test_bool_conversion

python/tests/test_array.py:355–363  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

353 self.assertEqual(x.tolist(), [1, 2, 3])
354
355 def test_bool_conversion(self):
356 x = mx.array(True)
357 self.assertTrue(x)
358 x = mx.array(False)
359 self.assertFalse(x)
360 x = mx.array(1.0)
361 self.assertTrue(x)
362 x = mx.array(0.0)
363 self.assertFalse(x)
364
365 def test_int_type(self):
366 x = mx.array(1)

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected