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

Method test_add_numpy

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

Source from the content-addressed store, hash-verified

1992 self.assertEqual(peak_1, peak_2)
1993
1994 def test_add_numpy(self):
1995 x = mx.array(1)
1996 y = np.array(2, dtype=np.int32)
1997 z = x + y
1998 self.assertEqual(z.dtype, mx.int32)
1999 self.assertEqual(z.item(), 3)
2000
2001 def test_dlpack(self):
2002 x = mx.array(1, dtype=mx.int32)

Callers

nothing calls this directly

Calls 2

itemMethod · 0.80
arrayMethod · 0.60

Tested by

no test coverage detected