mindspore/docs/api/api_python/ops/mindspore.ops.func_median.rst

18 lines
693 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.median
====================
.. py:function:: mindspore.ops.median(input, axis=-1, keepdims=False)
返回tensor在指定轴上的中位数及其索引。
.. warning::
- 如果 `input` 的中值不唯一,则 `indices` 不一定对应第一个出现的中值。该接口的具体实现方式和后端类型相关CPU和GPU的返回值可能不相同。
参数:
- **input** (Tensor) - 输入tensor。
- **axis** (int可选) - 指定计算的轴。默认 ``-1``
- **keepdims** (bool可选) - 输出tensor是否保留维度。默认 ``False``
返回:
两个tensor组成的tuple(median, median_indices)