update the result of example of Split, AdaptiveAvgPool2D and ReduceMean operators.

This commit is contained in:
wangshuide2020 2021-07-13 10:07:18 +08:00
parent 897ab2fe01
commit b2b66abdb0
5 changed files with 21 additions and 21 deletions

View File

@ -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

View File

@ -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)

View File

@ -460,8 +460,8 @@ class ReduceMean(_Reduce):
[5. ]
[6. ]]
[[7.0000005]
[5. ]
[6. ]]]
[8. ]
[9. ]]]
"""

View File

@ -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]]
"""

View File

@ -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+003.0000000e+00]))
(True, Tensor(shape = [3], dtype = Float32, value = [1.0000000e+00,2.0000000e+00,3.0000000e+00]))
"""
return (False, None)