Browse Source

!9576 Fixing errors in notes

From: @zhangz0911gm
Reviewed-by: @c_34,@liangchenghui
Signed-off-by: @c_34
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
ea724dca39
4 changed files with 10 additions and 10 deletions
  1. +2
    -2
      mindspore/nn/layer/basic.py
  2. +1
    -1
      mindspore/nn/probability/bijector/invert.py
  3. +1
    -1
      mindspore/ops/operations/math_ops.py
  4. +6
    -6
      mindspore/ops/operations/nn_ops.py

+ 2
- 2
mindspore/nn/layer/basic.py View File

@@ -756,8 +756,8 @@ class Triu(Cell):
>>> triu = nn.Triu()
>>> result = triu(x)
>>> print(result)
[[1 0]
[3 4]]
[[1 2]
[0 4]]
"""
def __init__(self):
super(Triu, self).__init__()


+ 1
- 1
mindspore/nn/probability/bijector/invert.py View File

@@ -44,7 +44,7 @@ class Invert(Bijector):
[0. 0.6931472 1.0986123]
>>> ans2 = inv_exp.inverse(value)
>>> print(ans2)
[ 2.7182817 7.389056 20.085537 ]
[ 2.718282 7.389056 20.085537]
>>> ans3 = inv_exp.forward_log_jacobian(value)
>>> print(ans3)
[-0. -0.6931472 -1.0986123]


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

@@ -3216,7 +3216,7 @@ class Cos(PrimitiveWithInfer):
>>> input_x = Tensor(np.array([0.24, 0.83, 0.31, 0.09]), mindspore.float32)
>>> output = cos(input_x)
>>> print(output)
[0.971338 0.67487574 0.95233357 0.9959527 ]
[0.971338 0.67487574 0.95233357 0.9959527 ]
"""

@prim_attr_register


+ 6
- 6
mindspore/ops/operations/nn_ops.py View File

@@ -3266,8 +3266,8 @@ class SigmoidCrossEntropyWithLogits(PrimitiveWithInfer):
>>> sigmoid = ops.SigmoidCrossEntropyWithLogits()
>>> output = sigmoid(logits, labels)
>>> print(output)
[[0.6111007 0.5032824 0.26318604]
[0.58439666 0.5530153 -0.4368139 ]]
[[ 0.6111007 0.5032824 0.26318604]
[ 0.58439666 0.5530153 -0.4368139 ]]
"""

@prim_attr_register
@@ -3309,10 +3309,10 @@ class Pad(PrimitiveWithInfer):
>>> pad_op = ops.Pad(((1, 2), (2, 1)))
>>> output = pad_op(input_tensor)
>>> print(output)
[[ 0. 0. 0. 0. 0. 0. ],
[ 0. 0. -0.1 0.3 3.6 0. ],
[ 0. 0. 0.4 0.5 -3.2 0. ],
[ 0. 0. 0. 0. 0. 0. ],
[[ 0. 0. 0. 0. 0. 0. ]
[ 0. 0. -0.1 0.3 3.6 0. ]
[ 0. 0. 0.4 0.5 -3.2 0. ]
[ 0. 0. 0. 0. 0. 0. ]
[ 0. 0. 0. 0. 0. 0. ]]
"""



Loading…
Cancel
Save