You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.ArgMinWithValue.rst 1.6 kB

4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536
  1. mindspore.ops.ArgMinWithValue
  2. ==============================
  3. .. py:class:: mindspore.ops.ArgMinWithValue(axis=0, keep_dims=False)
  4. 根据指定的索引计算最小值,并返回索引和值。
  5. 在给定轴上计算输入Tensor的最小值,并且返回最小值和索引。
  6. .. note::
  7. 在auto_parallel和semi_auto_parallel模式下,不能使用第一个输出索引。
  8. .. warning::
  9. - 如果有多个最小值,则取第一个最小值的索引。
  10. - "axis"的取值范围为[-dims, dims - 1]。"dims"为"input_x"的维度长度。
  11. **参数:**
  12. - **axis** (int) - 指定计算维度。默认值:0。
  13. - **keep_dims** (bool) - 表示是否减少维度。如果为True,则输出维度和输入维度相同。如果为False,则减少输出维度。默认值:False。
  14. **输入:**
  15. - **input_x** (Tensor) - 输入任意维度的Tensor。将输入Tensor的shape设为 :math:`(x_1, x_2, ..., x_N)` 。
  16. **输出:**
  17. tuple (Tensor),表示2个Tensor组成的tuple,包含对应的索引和输入Tensor的最小值。
  18. - **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)` 。
  19. - **output_x** (Tensor) - 输入Tensor的最小值,其shape与索引相同。
  20. **异常:**
  21. - **TypeError** - `keep_dims` 不是bool。
  22. - **TypeError** - `axis` 不是int。