From b2b66abdb0e845cef7ae3be57f9627ca3046fdf8 Mon Sep 17 00:00:00 2001 From: wangshuide2020 Date: Tue, 13 Jul 2021 10:07:18 +0800 Subject: [PATCH] update the result of example of Split, AdaptiveAvgPool2D and ReduceMean operators. --- mindspore/ops/operations/_inner_ops.py | 8 ++++---- mindspore/ops/operations/array_ops.py | 8 ++++---- mindspore/ops/operations/math_ops.py | 4 ++-- mindspore/ops/operations/nn_ops.py | 20 ++++++++++---------- mindspore/ops/primitive.py | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/mindspore/ops/operations/_inner_ops.py b/mindspore/ops/operations/_inner_ops.py index ce7e3fbe6fc..37c7bf3710a 100755 --- a/mindspore/ops/operations/_inner_ops.py +++ b/mindspore/ops/operations/_inner_ops.py @@ -723,10 +723,10 @@ class SequenceMask(PrimitiveWithCheck): >>> sequence_mask = ops.SequenceMask() >>> output = sequence_mask(x, 3) >>> print(output) - [[[True, False, False], - [True, True, True]], - [[True, True, False], - [False, False, False]]] + [[[True False False] + [True True True]] + [[True True False] + [False False False]]] """ @prim_attr_register diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index 27ff77e93e6..ddea0189ec3 100755 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -1040,10 +1040,10 @@ class Split(PrimitiveWithCheck): >>> output = split(x) >>> print(output) (Tensor(shape=[2, 2], dtype=Int32, value= - [[1 1] - [2 2]]), Tensor(shape=[2, 2], dtype=Int32, value= - [[1 1] - [2 2]])) + [[1, 1], + [2, 2]]), Tensor(shape=[2, 2], dtype=Int32, value= + [[1, 1], + [2, 2]])) >>> split = ops.Split(1, 4) >>> output = split(x) >>> print(output) diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index de200b43952..2d44b14d48d 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -460,8 +460,8 @@ class ReduceMean(_Reduce): [5. ] [6. ]] [[7.0000005] - [5. ] - [6. ]]] + [8. ] + [9. ]]] """ diff --git a/mindspore/ops/operations/nn_ops.py b/mindspore/ops/operations/nn_ops.py index d15df94ea44..c1f86649e5c 100755 --- a/mindspore/ops/operations/nn_ops.py +++ b/mindspore/ops/operations/nn_ops.py @@ -179,15 +179,15 @@ class AdaptiveAvgPool2D(PrimitiveWithInfer): >>> adaptive_avg_pool_2d = ops.AdaptiveAvgPool2D((None, 2)) >>> output = adaptive_avg_pool_2d(input_x) >>> print(output) - [[[2.5 3.5] + [[[1.5 2.5] [4.5 5.5] - [6.5 7.5]] - [[2.5 3.5] + [7.5 8.5]] + [[1.5 2.5] [4.5 5.5] - [6.5 7.5]] - [[2.5 3.5] + [7.5 8.5]] + [[1.5 2.5] [4.5 5.5] - [6.5 7.5]]] + [7.5 8.5]]] >>> # case 2: output_size=2 >>> adaptive_avg_pool_2d = ops.AdaptiveAvgPool2D(2) >>> output = adaptive_avg_pool_2d(input_x) @@ -202,9 +202,9 @@ class AdaptiveAvgPool2D(PrimitiveWithInfer): >>> adaptive_avg_pool_2d = ops.AdaptiveAvgPool2D((1, 2)) >>> output = adaptive_avg_pool_2d(input_x) >>> print(output) - [[[3.5 6.5]] - [[3.5 6.5]] - [[3.5 6.5]]] + [[[4.5 5.5]] + [[4.5 5.5]] + [[4.5 5.5]]] """ @prim_attr_register @@ -6723,7 +6723,7 @@ class ApplyFtrl(PrimitiveWithInfer): >>> net = ApplyFtrlNet() >>> input_x = Tensor(np.array([[0.3, 0.7], [0.1, 0.8]]).astype(np.float32)) >>> output = net(input_x) - >>> print(output) + >>> print(net.var.asnumpy()) [[ 0.0390525, 0.11492836] [ 0.00066425, 0.15075898]] """ diff --git a/mindspore/ops/primitive.py b/mindspore/ops/primitive.py index 42f0f24c6af..7e3df2639bc 100644 --- a/mindspore/ops/primitive.py +++ b/mindspore/ops/primitive.py @@ -236,7 +236,7 @@ class Primitive(Primitive_): >>> input_x = Tensor(np.array([1, 2, 3]), mindspore.float32) >>> output = addn.check_elim((input_x,)) >>> print(output) - (True, Tensor(shape = [3], dtype = Float32, value = [1.0000000e+00,2.0000000e+00,3.0000000e+00])) + (True, Tensor(shape = [3], dtype = Float32, value = [1.0000000e+00,2.0000000e+00,3.0000000e+00])) """ return (False, None)