Fixing errors in notes

pull/9576/head
zhangz0911gm 5 years ago
parent fcfe66f072
commit f8a20283e9

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

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

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

@ -3265,8 +3265,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
@ -3308,10 +3308,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