From cd8a501aad27f065b42ee1ebebca6b99fcd5db48 Mon Sep 17 00:00:00 2001 From: gengdongjie Date: Tue, 27 Jun 2023 17:20:13 +0800 Subject: [PATCH] fix bug for api doc --- mindspore/python/mindspore/nn/layer/activation.py | 6 +++--- mindspore/python/mindspore/ops/operations/math_ops.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mindspore/python/mindspore/nn/layer/activation.py b/mindspore/python/mindspore/nn/layer/activation.py index 6b9f3eb7f04..358d971e7a9 100644 --- a/mindspore/python/mindspore/nn/layer/activation.py +++ b/mindspore/python/mindspore/nn/layer/activation.py @@ -157,7 +157,6 @@ class Softmin(Cell): >>> output = softmin(x) >>> print(output) [0.2341 0.636 0.0862 0.01165 0.03168 ] - >>> assert(1.0 == output.sum()) """ def __init__(self, axis=-1): @@ -196,7 +195,9 @@ class Softmax2d(Cell): >>> softmax2d = nn.Softmax2d() >>> output = softmax2d(x) >>> print(output) - [[[[0.258, 0.28]], [[0.316, 0.342]], [[0.426, 0.378]]] + [[[[0.25838965 0.28001308]] + [[0.31559783 0.34200877]] + [[0.42601252 0.37797815]]]] """ def __init__(self): @@ -262,7 +263,6 @@ class Softmax(Cell): >>> output = softmax(x) >>> print(output) [0.03168 0.01166 0.0861 0.636 0.2341 ] - >>> assert(1.0 == output.sum()) """ def __init__(self, axis=-1): diff --git a/mindspore/python/mindspore/ops/operations/math_ops.py b/mindspore/python/mindspore/ops/operations/math_ops.py index afb84b8d8cb..9b238297261 100644 --- a/mindspore/python/mindspore/ops/operations/math_ops.py +++ b/mindspore/python/mindspore/ops/operations/math_ops.py @@ -2562,7 +2562,7 @@ class Reciprocal(PrimitiveWithCheck): >>> output = reciprocal(x) >>> print(output) [1. 0.5 0.25] - >>> x = Tensor(2.1+2j, mindspore.float32) + >>> x = Tensor(2.1+2j, mindspore.complex64) >>> reciprocal = ops.Reciprocal() >>> output = reciprocal(x) >>> print(output)