mlx-swift icon indicating copy to clipboard operation
mlx-swift copied to clipboard

[BUG] in-place updating of array slice with broadcasting

Open awni opened this issue 9 months ago • 1 comments

This was a bug in MLX core that I think got inherited in MLX Swift.

The following should work rather than throwing a broadcast error:

import MLX
let a = MLXArray.ones([2,6,6,6])
let b = MLXArray.zeros([3,4,4,4])
b[0,0..<4, 3, 0..<4] = a[0, 1..<5, 5, 1..<5]

Corresponding PR in MLX: https://github.com/ml-explore/mlx/pull/1035 Corresponding issue in MLX: https://github.com/ml-explore/mlx/issues/1050

awni avatar Apr 29 '24 14:04 awni

While preparing the change I ran into this: https://github.com/ml-explore/mlx/issues/1052

davidkoski avatar Apr 29 '24 16:04 davidkoski

Closing per #78

davidkoski avatar May 08 '24 15:05 davidkoski