!39702 fixed median doc

Merge pull request !39702 from liuchao/median
This commit is contained in:
i-robot 2022-08-08 02:00:40 +00:00 committed by Gitee
commit a397693ca6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 7 additions and 8 deletions

View File

@ -241,6 +241,7 @@ Reduction函数
mindspore.ops.logsumexp
mindspore.ops.max
mindspore.ops.mean
mindspore.ops.median
mindspore.ops.min
mindspore.ops.norm
mindspore.ops.prod

View File

@ -85,6 +85,7 @@ Reduction Methods
mindspore.Tensor.argmin_with_value
mindspore.Tensor.max
mindspore.Tensor.mean
mindspore.Tensor.median
mindspore.Tensor.min
mindspore.Tensor.norm
mindspore.Tensor.prod

View File

@ -243,6 +243,7 @@ Reduction Functions
mindspore.ops.logsumexp
mindspore.ops.max
mindspore.ops.mean
mindspore.ops.median
mindspore.ops.min
mindspore.ops.norm
mindspore.ops.prod

View File

@ -4742,15 +4742,11 @@ class Tensor(Tensor_):
axis (int): The dimension need to reduce. Default: 0.
keepdim (bool): Whether the output tensor need to retain `axis` dimension or not. Default: False.
Outputs:
Not exist when global_median is True.
Returns:
y (Tensor) - Has the same dtype as the self Tensor.
If `keep_dims` is true, the output tensors have the same dimension as the self Tensor except in
dimension `axis` which are of size 1. Otherwise, the outputs tensor have 1 fewer dimension than input.
y (Tensor) - Has the same dtype as the self Tensor. If `global_median` is true, the `y` has only one
element. If `keep_dims` is true, the `y` has the same shape as the self Tensor except the shape of
`y` in dimension `axis` is size 1. Otherwise, the `y` lacks `axis` dimension than input.
indices (Tensor) - Has the same shape as the `y`, but dtype is int64.
Not exist when global_median is True.
Raises:
TypeError: If dtype of self Tensor is not one of the following: int16, int32, int64, float32, double.

View File

@ -3087,7 +3087,7 @@ def median(x, global_median=False, axis=0, keep_dims=False):
ValueError: If `axis` is not in range of [-x.dim, x.dim-1].
Supported Platforms:
``Ascend`` ``CPU`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> # case 1 : common median compute