mlx.core.slice_update#
- slice_update(a: array, update: array, start_indices: array, axes: Sequence[int], *, stream: None | Stream | Device = None) array #
Update a sub-array of the input array.
- Parameters:
- Returns:
The output array with the same shape and type as the input.
- Return type:
Example
>>> a = mx.zeros((3, 3)) >>> mx.slice_update(a, mx.ones((1, 2)), start_indices=mx.array(1, 1), axes=(0, 1)) array([[0, 0, 0], [0, 1, 0], [0, 1, 0]], dtype=float32)