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

Method test_empty_matmuls

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

Source from the content-addressed store, hash-verified

2612 self.assertCmpNumpy([(3,), [2, 2, 2]], mx.tile, np.tile)
2613
2614 def test_empty_matmuls(self):
2615 a = mx.array([])
2616 b = mx.array([])
2617 self.assertEqual(mx.inner(a, b).item(), 0.0)
2618
2619 a = mx.zeros((10, 0))
2620 b = mx.zeros((0, 10))
2621 out = a @ b
2622 self.assertTrue(mx.array_equal(out, mx.zeros((10, 10))))
2623
2624 def test_diagonal(self):
2625 x = mx.array(

Callers

nothing calls this directly

Calls 3

itemMethod · 0.80
arrayMethod · 0.60
innerMethod · 0.45

Tested by

no test coverage detected