mlx-swift
mlx-swift copied to clipboard
[BUG] in-place updating of array slice with broadcasting
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
While preparing the change I ran into this: https://github.com/ml-explore/mlx/issues/1052
Closing per #78