From 9c6128c84c4735fb1569350920844b0c3ea1748a Mon Sep 17 00:00:00 2001 From: wangshuide2020 <7511764+wangshuide2020@user.noreply.gitee.com> Date: Wed, 23 Dec 2020 21:19:23 +0800 Subject: [PATCH] update the example of TensorAdd and DepthToSpace operator. --- mindspore/ops/operations/array_ops.py | 2 +- mindspore/ops/operations/math_ops.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index ee189c6585..37f2f874fb 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -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) diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index 726b67df6b..03cccdcbfb 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -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.]