Fix array initialization from list (#942)

* Fix array initialization from list

* Change the error message in the test
This commit is contained in:
Angelos Katharopoulos
2024-04-01 06:27:52 -07:00
committed by GitHub
parent 110d9b149d
commit 02fedbf1da
2 changed files with 23 additions and 14 deletions

View File

@@ -391,7 +391,9 @@ class TestArray(mlx_tests.MLXTestCase):
# shape check from `stack()`
with self.assertRaises(ValueError) as e:
mx.array([x, 1.0])
self.assertEqual(str(e.exception), "All arrays must have the same shape")
self.assertEqual(
str(e.exception), "Initialization encountered non-uniform length."
)
# shape check from `validate_shape`
with self.assertRaises(ValueError) as e: