Browse Source

Fix some mistakes of InplaceAddD and InplaceSubD vm ops

tags/v0.5.0-beta
liuwenhao4 5 years ago
parent
commit
41b6912d92
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      mindspore/ops/operations/math_ops.py

+ 2
- 2
mindspore/ops/operations/math_ops.py View File

@@ -791,7 +791,7 @@ class InplaceAdd(PrimitiveWithInfer):
Tensor, has the same shape and dtype as input. Tensor, has the same shape and dtype as input.


Examples: Examples:
>>> indices = [0, 1]
>>> indices = (0, 1)
>>> input_x = Tensor(np.array([[1, 2], [3, 4], [5, 6]]), mindspore.float32) >>> input_x = Tensor(np.array([[1, 2], [3, 4], [5, 6]]), mindspore.float32)
>>> input_v = Tensor(np.array([[0.5, 1.0], [1.0, 1.5]]), mindspore.float32) >>> input_v = Tensor(np.array([[0.5, 1.0], [1.0, 1.5]]), mindspore.float32)
>>> inplaceAdd = P.InplaceAdd(indices) >>> inplaceAdd = P.InplaceAdd(indices)
@@ -850,7 +850,7 @@ class InplaceSub(PrimitiveWithInfer):
Tensor, has the same shape and dtype as input. Tensor, has the same shape and dtype as input.


Examples: Examples:
>>> indices = [0, 1]
>>> indices = (0, 1)
>>> input_x = Tensor(np.array([[1, 2], [3, 4], [5, 6]]), mindspore.float32) >>> input_x = Tensor(np.array([[1, 2], [3, 4], [5, 6]]), mindspore.float32)
>>> input_v = Tensor(np.array([[0.5, 1.0], [1.0, 1.5]]), mindspore.float32) >>> input_v = Tensor(np.array([[0.5, 1.0], [1.0, 1.5]]), mindspore.float32)
>>> inplaceSub = P.InplaceSub(indices) >>> inplaceSub = P.InplaceSub(indices)


Loading…
Cancel
Save