forked from mindspore-Ecosystem/mindspore
!20988 fix the wrong output of the MulNoNan and Minimum example
Merge pull request !20988 from dinglinhe/code_docs_dlh_ms_I42F60
This commit is contained in:
commit
0660666459
|
@ -2308,14 +2308,14 @@ class Minimum(_MathBinaryOp):
|
|||
>>> # case 1 : same data type
|
||||
>>> x = Tensor(np.array([1.0, 5.0, 3.0]), mindspore.float32)
|
||||
>>> y = Tensor(np.array([4.0, 2.0, 6.0]), mindspore.float32)
|
||||
>>> minimum = ops.Minimum()
|
||||
>>> minimum = ops.Minimum
|
||||
>>> output = minimum(x, y)
|
||||
>>> print(output)
|
||||
[1. 2. 3.]
|
||||
>>> # case 2 : different data type
|
||||
>>> x = Tensor(np.array([1.0, 5.0, 3.0]), mindspore.int32)
|
||||
>>> y = Tensor(np.array([4.0, 2.0, 6.0]), mindspore.float32)
|
||||
>>> output = Minimum(x, y)
|
||||
>>> output = minimum(x, y)
|
||||
>>> print(output.dtype)
|
||||
Float32
|
||||
"""
|
||||
|
@ -2596,7 +2596,7 @@ class MulNoNan(_MathBinaryOp):
|
|||
Float32
|
||||
>>> # case 3 : the y is a scalar.
|
||||
>>> x = Tensor(np.array([[-1.0, 6.0, 0], [0, np.nan, 4.0]]), mindspore.float32)
|
||||
>>> y = Tensor(0, [np.nan, 0, 1.0]]), mindspore.float32)
|
||||
>>> y = Tensor(0, mindspore.float32)
|
||||
>>> output = mul_no_nan(x, y)
|
||||
>>> print(output)
|
||||
[[ 0. 0. 0.]
|
||||
|
|
Loading…
Reference in New Issue