From 60e8f0b7dca8ffa1eb4673c745abe3ed06425874 Mon Sep 17 00:00:00 2001 From: liangzelang Date: Tue, 12 Jul 2022 14:49:32 +0800 Subject: [PATCH] fix comments error. --- mindspore/python/mindspore/ops/function/array_func.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mindspore/python/mindspore/ops/function/array_func.py b/mindspore/python/mindspore/ops/function/array_func.py index 38f15290eeb..f4339f473d8 100644 --- a/mindspore/python/mindspore/ops/function/array_func.py +++ b/mindspore/python/mindspore/ops/function/array_func.py @@ -2360,12 +2360,14 @@ def tensor_scatter_min(input_x, indices, updates): ``Ascend`` ``GPU`` ``CPU`` Examples: + >>> import mindspore >>> import numpy as np >>> from mindspore import Tensor - >>> x = Tensor(np.array([[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]]).astype('float32')) - >>> indices = Tensor(np.array([[0, 0], [0, 0]]).astype('int32')) - >>> updates = Tensor(np.array([1.0, 2.2]).astype('float32')) - >>> output = x.tensor_scatter_min(indices, updates) + >>> from mindspore import ops + >>> input_x = Tensor(np.array([[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]]), mindspore.float32) + >>> indices = Tensor(np.array([[0, 0], [0, 0]]), mindspore.int32) + >>> updates = Tensor(np.array([1.0, 2.2]), mindspore.float32) + >>> output = ops.tensor_scatter_min(input_x, indices, updates) >>> print(output) [[ -0.1 0.3 3.6] [ 0.4 0.5 -3.2]]