forked from mindspore-Ecosystem/mindspore
!9166 FIx errors in classes' examples
From: @zhangz0911gm Reviewed-by: @liangchenghui Signed-off-by:
This commit is contained in:
commit
73cea20aab
|
@ -128,13 +128,13 @@ def uniform(shape, minval, maxval, seed=None, dtype=mstype.float32):
|
|||
The dtype is designated as the input `dtype`.
|
||||
|
||||
Examples:
|
||||
>>> For discrete uniform distribution, only one number is allowed for both minval and maxval:
|
||||
>>> # For discrete uniform distribution, only one number is allowed for both minval and maxval:
|
||||
>>> shape = (4, 2)
|
||||
>>> minval = Tensor(1, mstype.int32)
|
||||
>>> maxval = Tensor(2, mstype.int32)
|
||||
>>> output = C.uniform(shape, minval, maxval, seed=5, dtype=mstype.int32)
|
||||
>>>
|
||||
>>> For continuous uniform distribution, minval and maxval can be multi-dimentional:
|
||||
>>> # For continuous uniform distribution, minval and maxval can be multi-dimentional:
|
||||
>>> shape = (4, 2)
|
||||
>>> minval = Tensor([1.0, 2.0], mstype.float32)
|
||||
>>> maxval = Tensor([4.0, 5.0], mstype.float32)
|
||||
|
|
|
@ -1151,8 +1151,8 @@ class Ones(PrimitiveWithInfer):
|
|||
>>> ones = ops.Ones()
|
||||
>>> output = ones((2, 2), mindspore.float32)
|
||||
>>> print(output)
|
||||
[[1.0, 1.0],
|
||||
[1.0, 1.0]]
|
||||
[[1. 1.]
|
||||
[1. 1.]]
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
@ -1204,8 +1204,8 @@ class Zeros(PrimitiveWithInfer):
|
|||
>>> zeros = ops.Zeros()
|
||||
>>> output = zeros((2, 2), mindspore.float32)
|
||||
>>> print(output)
|
||||
[[0.0, 0.0],
|
||||
[0.0, 0.0]]
|
||||
[[0. 0.]
|
||||
[0. 0.]]
|
||||
|
||||
"""
|
||||
|
||||
|
@ -3348,7 +3348,8 @@ class ScatterSub(_ScatterOp):
|
|||
>>> scatter_sub = ops.ScatterSub()
|
||||
>>> output = scatter_sub(input_x, indices, updates)
|
||||
>>> print(output)
|
||||
[[-1.0, -1.0, -1.0], [-1.0, -1.0, -1.0]]
|
||||
[[-1. -1. -1.]
|
||||
[-1. -1. -1.]]
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
@ -1376,8 +1376,8 @@ class Rsqrt(PrimitiveWithInfer):
|
|||
>>> rsqrt = ops.Rsqrt()
|
||||
>>> output = rsqrt(input_tensor)
|
||||
>>> print(output)
|
||||
[[0.5 0.5 ]
|
||||
[0.333334 0.333334]]
|
||||
[[0.5 0.5 ]
|
||||
[0.33333334 0.33333334]]
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
@ -1677,7 +1677,7 @@ class Log(PrimitiveWithInfer):
|
|||
>>> log = ops.Log()
|
||||
>>> output = log(input_x)
|
||||
>>> print(output)
|
||||
[0. 0.6931472 1.38629444]
|
||||
[0. 0.6931472 1.3862944]
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
|
Loading…
Reference in New Issue