!38716 modify max functional docs

Merge pull request !38716 from zhouxulin2/code_docs_fixed
This commit is contained in:
i-robot 2022-07-25 06:42:21 +00:00 committed by Gitee
commit 43f6f9a8dc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 31 additions and 34 deletions

View File

@ -1,34 +0,0 @@
mindspore.ops.max
==============================
.. py:function:: mindspore.ops.max(x, axis=0, keep_dims=False)
根据指定的索引计算最大值,并返回索引和值。
在给定轴上计算输入Tensor的最大值并且返回最大值和索引。
.. note::
在auto_parallel和semi_auto_parallel模式下不能使用第一个输出索引。
.. warning::
- 如果有多个最大值,则取第一个最大值的索引。
- "axis"的取值范围为[-dims, dims - 1]。"dims"为"x"的维度长度。
**参数:**
- **x** (Tensor) - 输入任意维度的Tensor。将输入Tensor的shape设为 :math:`(x_1, x_2, ..., x_N)` 。数据类型为mindspore.float16或float32。
- **axis** (int) - 指定计算维度。默认值0。
- **keep_dims** (bool) - 表示是否减少维度如果为True输出将与输入保持相同的维度如果为False输出将减少维度。默认值False。
**返回:**
tuple (Tensor)表示2个Tensor组成的tuple包含对应的索引和输入Tensor的最大值。
- **index** (Tensor) - 输入Tensor最大值的索引。如果 `keep_dims` 为True则输出Tensor的shape为 :math:`(x_1, x_2, ..., x_{axis-1}, 1, x_{axis+1}, ..., x_N)` 。否则shape为 :math:`(x_1, x_2, ..., x_{axis-1}, x_{axis+1}, ..., x_N)`
- **output_x** (Tensor) - 输入Tensor的最大值其shape与索引相同。
**异常:**
- **TypeError** - `input_x` 的数据类型非float16、float32或float64。
- **TypeError** - `keep_dims` 不是bool。
- **TypeError** - `axis` 不是int。

View File

@ -0,0 +1,31 @@
mindspore.ops.max
=================
.. py:function:: mindspore.ops.max(x, axis=0, keep_dims=False)
根据指定的索引计算最大值,并返回索引和值。
在给定轴上计算输入Tensor的最大值并且返回最大值和索引。
.. note::
在auto_parallel和semi_auto_parallel模式下不能使用第一个输出索引。
.. warning::
- 如果有多个最大值,则取第一个最大值的索引。
- "axis"的取值范围为[-dims, dims - 1]。"dims"为"x"的维度长度。
参数:
- **x** (Tensor) - 输入任意维度的Tensor。将输入Tensor的shape设为 :math:`(x_1, x_2, ..., x_N)` 。数据类型为mindspore.float16或float32。
- **axis** (int) - 指定计算维度。默认值0。
- **keep_dims** (bool) - 表示是否减少维度如果为True输出将与输入保持相同的维度如果为False输出将减少维度。默认值False。
返回:
tuple (Tensor)表示2个Tensor组成的tuple包含对应的索引和输入Tensor的最大值。
- **index** (Tensor) - 输入Tensor最大值的索引。如果 `keep_dims` 为True则输出Tensor的shape为 :math:`(x_1, x_2, ..., x_{axis-1}, 1, x_{axis+1}, ..., x_N)` 。否则shape为 :math:`(x_1, x_2, ..., x_{axis-1}, x_{axis+1}, ..., x_N)`
- **output_x** (Tensor) - 输入Tensor的最大值其shape与索引相同。
异常:
- **TypeError** - `input_x` 的数据类型非float16、float32或float64。
- **TypeError** - `keep_dims` 不是bool。
- **TypeError** - `axis` 不是int。