mindspore.ops.tensor_scatter_min
- mindspore.ops.tensor_scatter_min(input_x, indices, updates)[source]
Return a new tensor by performing a minimum update on input_x at the specified indices with the given update values.
\[output\left [indices \right ] = \min(input\_x, updates)\]Note
On GPU, if some values of the indices are out of bounds, instead of raising an index error, the corresponding updates will not be updated to self tensor.
On CPU, if some values of the indices are out of bounds, raising an index error.
On Ascend, out of bounds checking is not supported, if some values of the indices are out of bounds, unknown errors may be caused.
- Parameters
- Returns
Tensor
- Supported Platforms:
AscendGPUCPU
Examples
>>> import mindspore >>> input_x = mindspore.tensor([[1, 2, 3], [4, 5, 6]], mindspore.float32) >>> indices = mindspore.tensor([[0, 0], [1, 1]]) >>> updates = mindspore.tensor([5, 1], mindspore.float32) >>> mindspore.ops.tensor_scatter_min(input_x, indices, updates) Tensor(shape=[2, 3], dtype=Float32, value= [[ 1.00000000e+00, 2.00000000e+00, 3.00000000e+00], [ 4.00000000e+00, 1.00000000e+00, 6.00000000e+00]])