!39205 Fix the output of argminwithvalue

Merge pull request !39205 from ZPaC/code_docs-fix-output-argminwithvalue
This commit is contained in:
i-robot 2022-07-30 03:06:28 +00:00 committed by Gitee
commit 2ab063fa94
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 14 additions and 14 deletions

View File

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

View File

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

View File

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