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

Method test_real_imag

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

Source from the content-addressed store, hash-verified

2250 mx.add(y, x)
2251
2252 def test_real_imag(self):
2253 x = mx.array([1.0])
2254 self.assertEqual(x.real.item(), 1.0)
2255 self.assertEqual(x.imag.item(), 0.0)
2256
2257 x = mx.array([1.0 + 1.0j])
2258 self.assertEqual(x.imag.item(), 1.0)
2259 self.assertEqual(x.real.item(), 1.0)
2260
2261 def test_large_indices(self):
2262 x = mx.array([0, 1, 2])

Callers

nothing calls this directly

Calls 2

itemMethod · 0.80
arrayMethod · 0.60

Tested by

no test coverage detected