Browse Source

!8364 modify scattersub example

From: @lijiaqi0612
Reviewed-by: @kingxian,@zhunaipan
Signed-off-by: @zhunaipan
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
62d9dc06c5
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/ops/operations/array_ops.py

+ 1
- 1
mindspore/ops/operations/array_ops.py View File

@@ -2957,7 +2957,7 @@ class ScatterSub(_ScatterOp):
Examples: Examples:
>>> input_x = Parameter(Tensor(np.array([[0.0, 0.0, 0.0], [1.0, 1.0, 1.0]]), mindspore.float32), name="x") >>> input_x = Parameter(Tensor(np.array([[0.0, 0.0, 0.0], [1.0, 1.0, 1.0]]), mindspore.float32), name="x")
>>> indices = Tensor(np.array([[0, 1]]), mindspore.int32) >>> indices = Tensor(np.array([[0, 1]]), mindspore.int32)
>>> updates = Tensor(np.array([[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]), mindspore.float32)
>>> updates = Tensor(np.array([[[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]), mindspore.float32)
>>> scatter_sub = P.ScatterSub() >>> scatter_sub = P.ScatterSub()
>>> output = scatter_sub(input_x, indices, updates) >>> output = scatter_sub(input_x, indices, updates)
[[-1.0, -1.0, -1.0], [-1.0, -1.0, -1.0]] [[-1.0, -1.0, -1.0], [-1.0, -1.0, -1.0]]


Loading…
Cancel
Save