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

Method test_logical_overloads

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

Source from the content-addressed store, hash-verified

1875 )
1876
1877 def test_logical_overloads(self):
1878 with self.assertRaises(ValueError):
1879 mx.array(1.0) & mx.array(1)
1880 with self.assertRaises(ValueError):
1881 mx.array(1.0) | mx.array(1)
1882
1883 self.assertEqual((mx.array(True) & True).item(), True)
1884 self.assertEqual((mx.array(True) & False).item(), False)
1885 self.assertEqual((mx.array(True) | False).item(), True)
1886 self.assertEqual((mx.array(False) | False).item(), False)
1887 self.assertEqual((~mx.array(False)).item(), True)
1888 self.assertEqual((mx.array(False) ^ True).item(), True)
1889
1890 def test_inplace(self):
1891 iops = [

Callers

nothing calls this directly

Calls 2

itemMethod · 0.80
arrayMethod · 0.60

Tested by

no test coverage detected