mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-18 10:26:56 +08:00
[Fix] expand axes for dimension with integer indices in mlx_slice_update (#1035)
* Not sure if this is correct * Format * Edit tests * Add negative test * Format * add one more test --------- Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
@@ -845,9 +845,7 @@ auto mlx_slice_update(
|
||||
st = (st < 0) ? st + src.shape(ax) : st;
|
||||
starts[ax] = st;
|
||||
stops[ax] = st + 1;
|
||||
if (src.ndim() - ax < up.ndim()) {
|
||||
upd_expand_dims.push_back(ax - src.ndim());
|
||||
}
|
||||
upd_expand_dims.push_back(ax);
|
||||
ax++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user