From: @zhangz0911gm Reviewed-by: @c_34,@liangchenghui Signed-off-by: @c_34tags/v1.1.0
| @@ -756,8 +756,8 @@ class Triu(Cell): | |||||
| >>> triu = nn.Triu() | >>> triu = nn.Triu() | ||||
| >>> result = triu(x) | >>> result = triu(x) | ||||
| >>> print(result) | >>> print(result) | ||||
| [[1 0] | |||||
| [3 4]] | |||||
| [[1 2] | |||||
| [0 4]] | |||||
| """ | """ | ||||
| def __init__(self): | def __init__(self): | ||||
| super(Triu, self).__init__() | super(Triu, self).__init__() | ||||
| @@ -44,7 +44,7 @@ class Invert(Bijector): | |||||
| [0. 0.6931472 1.0986123] | [0. 0.6931472 1.0986123] | ||||
| >>> ans2 = inv_exp.inverse(value) | >>> ans2 = inv_exp.inverse(value) | ||||
| >>> print(ans2) | >>> print(ans2) | ||||
| [ 2.7182817 7.389056 20.085537 ] | |||||
| [ 2.718282 7.389056 20.085537] | |||||
| >>> ans3 = inv_exp.forward_log_jacobian(value) | >>> ans3 = inv_exp.forward_log_jacobian(value) | ||||
| >>> print(ans3) | >>> print(ans3) | ||||
| [-0. -0.6931472 -1.0986123] | [-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) | >>> input_x = Tensor(np.array([0.24, 0.83, 0.31, 0.09]), mindspore.float32) | ||||
| >>> output = cos(input_x) | >>> output = cos(input_x) | ||||
| >>> print(output) | >>> print(output) | ||||
| [0.971338 0.67487574 0.95233357 0.9959527 ] | |||||
| [0.971338 0.67487574 0.95233357 0.9959527 ] | |||||
| """ | """ | ||||
| @prim_attr_register | @prim_attr_register | ||||
| @@ -3266,8 +3266,8 @@ class SigmoidCrossEntropyWithLogits(PrimitiveWithInfer): | |||||
| >>> sigmoid = ops.SigmoidCrossEntropyWithLogits() | >>> sigmoid = ops.SigmoidCrossEntropyWithLogits() | ||||
| >>> output = sigmoid(logits, labels) | >>> output = sigmoid(logits, labels) | ||||
| >>> print(output) | >>> 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 | @prim_attr_register | ||||
| @@ -3309,10 +3309,10 @@ class Pad(PrimitiveWithInfer): | |||||
| >>> pad_op = ops.Pad(((1, 2), (2, 1))) | >>> pad_op = ops.Pad(((1, 2), (2, 1))) | ||||
| >>> output = pad_op(input_tensor) | >>> output = pad_op(input_tensor) | ||||
| >>> print(output) | >>> 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. ]] | [ 0. 0. 0. 0. 0. 0. ]] | ||||
| """ | """ | ||||