Close a couple edge case bugs: hadamard and addmm on empty inputs (#2177)

* handle hadamard and addmm on empty inputs

* fix
This commit is contained in:
Awni Hannun
2025-05-12 10:48:57 -07:00
committed by GitHub
parent caaa3f1f8c
commit 8f3d208dce
5 changed files with 52 additions and 1 deletions

View File

@@ -2830,6 +2830,9 @@ class TestOps(mlx_tests.MLXTestCase):
return H
def test_hadamard(self):
with self.assertRaises(ValueError):
mx.hadamard_transform(mx.array([]))
h28_str = """
+------++----++-+--+-+--++--
-+-----+++-----+-+--+-+--++-