2.6K Star 8.5K Fork 4.8K

GVPMindSpore/mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.mint.func_cumsum.rst 779 Bytes
一键复制 编辑 原始数据 按行查看 历史
吴大维 提交于 2024-05-31 16:38 . add mint cumsum

mindspore.mint.cumsum

.. py:function:: mindspore.mint.cumsum(input, dim, dtype=None)

    计算输入Tensor `input` 沿轴 `dim` 的累积和。

    .. math::
        y_i = x_1 + x_2 + x_3 + ... + x_i

    参数:
        - **input** (Tensor) - 输入Tensor。
        - **dim** (int) - 累积和计算的轴。
        - **dtype** (:class:`mindspore.dtype`, 可选) - 输出数据类型。如果不为None,则输入会转化为 `dtype`。这有利于防止数值溢出。如果为None,则输出和输入的数据类型一致。默认值: ``None`` 。

    返回:
        Tensor,和输入Tensor的shape相同。

    异常:
        - **TypeError** - 如果 `input` 不是Tensor。
        - **ValueError** - 如果 `dim` 超出范围。
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385