mindspore.ops.inplace_update
- mindspore.ops.inplace_update(x, v, indices)[source]
Updates x to v according to the indices.
Warning
This is an experimental API that is subject to change or deletion.
for each i, …, j in indices :
- Parameters
- Returns
Tensor
- Supported Platforms:
GPU
CPU
Examples
>>> import mindspore >>> indices = (0, 1) >>> x = mindspore.tensor([[1, 2], [3, 4], [5, 6]], mindspore.float32) >>> v = mindspore.tensor([[0.5, 1.0], [1.0, 1.5]], mindspore.float32) >>> output = mindspore.ops.inplace_update(x, v, indices) >>> print(output) [[0.5 1. ] [1. 1.5] [5. 6. ]]