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

23 lines
907 B
ReStructuredText
Raw Normal View History

2022-06-28 17:19:46 +08:00
mindspore.ops.cummax
====================
.. py:function:: mindspore.ops.cummax(x, axis)
返回一个元组(最值、索引),其中最值是输入张量 `x` 沿维度 `axis` 的累积最大值,索引是每个最大值的索引位置。
.. math::
\begin{array}{ll} \\
y{i} = max(x{1}, x{2}, ... , x{i})
\end{array}
2022-07-25 15:09:45 +08:00
参数:
- **x** (Tensor) - 输入Tensor要求维度大于0。
- **axis** (int) - 算子操作的维度,维度的大小范围是[-x.ndim, x.ndim - 1]。
2022-06-28 17:19:46 +08:00
2022-07-25 15:09:45 +08:00
返回:
一个包含两个Tensor的元组分别表示累积最大值和对应索引。每个输出Tensor的形状和输入Tensor的形状相同。
2022-06-28 17:19:46 +08:00
2022-07-25 15:09:45 +08:00
异常:
- **TypeError** - 如果 `x` 不是Tensor。
- **TypeError** - 如果 `axis` 不是int。
- **ValueError** - 如果 `axis` 不在范围[-x.ndim, x.ndim - 1]内。