mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-18 07:18:29 +08:00
Fix put_along_axis for empty arrays (#2181)
This commit is contained in:

committed by
GitHub

parent
8f3d208dce
commit
3aa9cf3f9e
@@ -1255,6 +1255,12 @@ class TestOps(mlx_tests.MLXTestCase):
|
||||
np.put_along_axis(out_np, np.array(indices), np.array(update), axis=-2)
|
||||
self.assertTrue(np.array_equal(out_np, np.array(out_mlx)))
|
||||
|
||||
a = mx.array([], mx.float32)
|
||||
b = mx.put_along_axis(a, a, a, axis=None)
|
||||
mx.eval(b)
|
||||
self.assertEqual(b.size, 0)
|
||||
self.assertEqual(b.shape, a.shape)
|
||||
|
||||
def test_split(self):
|
||||
a = mx.array([1, 2, 3])
|
||||
splits = mx.split(a, 3)
|
||||
|
Reference in New Issue
Block a user