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

23 lines
911 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.cummax
====================
.. py:function:: mindspore.ops.cummax(x, axis)
返回一个元组最值、索引其中最值是输入Tensor `x` 沿维度 `axis` 的累积最大值,索引是每个最大值的索引位置。
.. math::
\begin{array}{ll} \\
y_{i} = max(x_{1}, x_{2}, ... , x_{i})
\end{array}
参数:
- **x** (Tensor) - 输入Tensor要求维度大于0。
- **axis** (int) - 算子操作的维度,维度的大小范围是[-x.ndim, x.ndim - 1]。
返回:
一个包含两个Tensor的元组分别表示累积最大值和对应索引。每个输出Tensor的形状和输入Tensor的形状相同。
异常:
- **TypeError** - 如果 `x` 不是Tensor。
- **TypeError** - 如果 `axis` 不是int。
- **ValueError** - 如果 `axis` 不在范围[-x.ndim, x.ndim - 1]内。