Browse Source

!10407 update the example of TensorAdd and DepthToSpace operator.

From: @wangshuide2020
Reviewed-by: @liangchenghui,@wuxuejian
Signed-off-by: @liangchenghui
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
1db198f3a6
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      mindspore/ops/operations/array_ops.py
  2. +2
    -2
      mindspore/ops/operations/math_ops.py

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

@@ -3703,7 +3703,7 @@ class DepthToSpace(PrimitiveWithInfer):
``Ascend``

Examples:
>>> x = Tensor(np.random.rand(1,12,1,1), mindspore.float32)
>>> x = Tensor(np.random.rand(1, 12, 1, 1), mindspore.float32)
>>> block_size = 2
>>> depth_to_space = ops.DepthToSpace(block_size)
>>> output = depth_to_space(x)


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

@@ -140,8 +140,8 @@ class TensorAdd(_MathBinaryOp):

Examples:
>>> add = ops.TensorAdd()
>>> input_x = Tensor(np.array([1,2,3]).astype(np.float32))
>>> input_y = Tensor(np.array([4,5,6]).astype(np.float32))
>>> input_x = Tensor(np.array([1, 2, 3]).astype(np.float32))
>>> input_y = Tensor(np.array([4, 5, 6]).astype(np.float32))
>>> output = add(input_x, input_y)
>>> print(output)
[5. 7. 9.]


Loading…
Cancel
Save