!39205 Fix the output of argminwithvalue
Merge pull request !39205 from ZPaC/code_docs-fix-output-argminwithvalue
This commit is contained in:
commit
2ab063fa94
|
@ -2215,11 +2215,11 @@ class Tensor(Tensor_):
|
|||
|
||||
Examples:
|
||||
>>> x = Tensor(np.array([0.0, 0.4, 0.6, 0.7, 0.1]), mindspore.float32)
|
||||
>>> output = x.argmin_with_value()
|
||||
>>> print(output)
|
||||
>>> index, output = x.argmin_with_value()
|
||||
>>> print(index, output)
|
||||
0 0.0
|
||||
>>> output = x.argmin_with_value(keep_dims=True)
|
||||
>>> print(output)
|
||||
>>> index, output = x.argmin_with_value(keep_dims=True)
|
||||
>>> print(index, output)
|
||||
[0] [0.0]
|
||||
"""
|
||||
self._init_check()
|
||||
|
|
|
@ -4071,11 +4071,11 @@ def min(x, axis=0, keep_dims=False):
|
|||
|
||||
Examples:
|
||||
>>> x = Tensor(np.array([0.0, 0.4, 0.6, 0.7, 0.1]), mindspore.float32)
|
||||
>>> output = ops.min(x)
|
||||
>>> print(output)
|
||||
>>> index, output = ops.min(x)
|
||||
>>> print(index, output)
|
||||
0 0.0
|
||||
>>> output = ops.min(x, keep_dims=True)
|
||||
>>> print(output)
|
||||
>>> index, output = ops.min(x, keep_dims=True)
|
||||
>>> print(index, output)
|
||||
[0] [0.0]
|
||||
"""
|
||||
argmin_with_value_op = P.ArgMinWithValue(axis, keep_dims)
|
||||
|
|
|
@ -2190,12 +2190,12 @@ class ArgMinWithValue(Primitive):
|
|||
|
||||
Examples:
|
||||
>>> x = Tensor(np.array([0.0, 0.4, 0.6, 0.7, 0.1]), mindspore.float32)
|
||||
>>> output = ops.ArgMinWithValue()(x)
|
||||
>>> print(output)
|
||||
(Tensor(shape=[], dtype=Int32, value= 0), Tensor(shape=[], dtype=Float32, value= 0))
|
||||
>>> output = ops.ArgMinWithValue(keep_dims=True)(x)
|
||||
>>> print(output)
|
||||
(Tensor(shape=[1], dtype=Int32, value= [0]), Tensor(shape=[1], dtype=Float32, value= [ 0.00000000e+00]))
|
||||
>>> index, output = ops.ArgMinWithValue()(x)
|
||||
>>> print(index, output)
|
||||
0 0.0
|
||||
>>> index, output = ops.ArgMinWithValue(keep_dims=True)(x)
|
||||
>>> print(index, output)
|
||||
[0] [0.0]
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
|
Loading…
Reference in New Issue