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

24 lines
1.1 KiB
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.CumSum
=====================
.. py:class:: mindspore.ops.CumSum(exclusive=False, reverse=False)
计算输入Tensor在指定轴上的累加和。
.. math::
y_i = x_1 + x_2 + x_3 + ... + x_i
参数:
- **exclusive** (bool可选) - 表示输出结果的第一个元素是否与输入的第一个元素一致。如果为 ``False`` ,表示输出的第一个元素与输入的第一个元素一致。默认值: ``False``
- **reverse** (bool可选) - 如果为 ``True`` ,则逆向计算累加和。默认值: ``False``
输入:
- **input** (Tensor) - 输入Tensorshape为 :math:`(N, *)` ,其中 :math:`*` 为任意数量的额外维度。
- **axis** (int) - 指定要进行累加和计算的轴。仅支持常量值,该值应在[-rank(input), rank(input))范围内。
输出:
Tensor。输出Tensor的shape与输入Tensor的shape一致。
异常:
- **TypeError** - `exclusive``reverse` 不是bool。
- **TypeError** - `axis` 不是int。