diff --git a/mindspore/python/mindspore/ops/function/array_func.py b/mindspore/python/mindspore/ops/function/array_func.py index 79ad73b09ef..d26608e9108 100644 --- a/mindspore/python/mindspore/ops/function/array_func.py +++ b/mindspore/python/mindspore/ops/function/array_func.py @@ -1737,8 +1737,7 @@ def scatter_nd_mul(input_x, indices, updates, use_locking=False): >>> input_x = Parameter(Tensor(np.array([1, 2, 3, 4, 5, 6, 7, 8]), mindspore.float32), name="x") >>> indices = Tensor(np.array([[2], [4], [1], [7]]), mindspore.int32) >>> updates = Tensor(np.array([6, 7, 8, 9]), mindspore.float32) - >>> scatter_nd_mul = ops.ScatterNdMul() - >>> output = scatter_nd_mul(input_x, indices, updates) + >>> output = ops.scatter_nd_mul(input_x, indices, updates) >>> print(output) [ 1. 16. 18. 4. 35. 6. 7. 72.] >>> input_x = Parameter(Tensor(np.ones((4, 4, 4)), mindspore.int32)) diff --git a/mindspore/python/mindspore/ops/operations/array_ops.py b/mindspore/python/mindspore/ops/operations/array_ops.py index b1d0c2b00d9..9deff30c27e 100755 --- a/mindspore/python/mindspore/ops/operations/array_ops.py +++ b/mindspore/python/mindspore/ops/operations/array_ops.py @@ -5086,10 +5086,11 @@ class ScatterNdMul(_ScatterNdOp): ``GPU`` ``CPU`` Examples: + >>> from mindspore.ops.operations.array_ops import ScatterNdMul >>> input_x = Parameter(Tensor(np.array([1, 2, 3, 4, 5, 6, 7, 8]), mindspore.float32), name="x") >>> indices = Tensor(np.array([[2], [4], [1], [7]]), mindspore.int32) >>> updates = Tensor(np.array([6, 7, 8, 9]), mindspore.float32) - >>> scatter_nd_mul = ops.ScatterNdMul() + >>> scatter_nd_mul = ScatterNdMul() >>> output = scatter_nd_mul(input_x, indices, updates) >>> print(output) [ 1. 16. 18. 4. 35. 6. 7. 72.]