You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.CumSum.rst 950 B

12345678910111213141516171819202122232425262728
  1. mindspore.ops.CumSum
  2. =====================
  3. .. py:class:: mindspore.ops.CumSum(exclusive=False, reverse=False)
  4. 计算输入Tensor在指定轴上的累加和。
  5. .. math::
  6. y_i = x_1 + x_2 + x_3 + ...+ x_i
  7. **参数:**
  8. - **exclusive** (bool) - 表示输出结果的第一个元素是否与输入的第一个元素一致。如果为False,表示输出的第一个元素与输入的第一个元素一致。默认值:False。
  9. - **reverse** (bool) - 如果为True,则逆向计算累加和。默认值:False。
  10. **输入:**
  11. - **input** (Tensor) - 输入要计算的Tensor。
  12. - **axis** (int) - 指定要累加和的轴。仅支持常量值。该值在[-rank(input), rank(input))范围中。
  13. **输出:**
  14. Tensor。输出Tensor的shape与输入Tensor的shape一致。
  15. **异常:**
  16. - **TypeError** - `exclusive` 或 `reverse` 不是bool。
  17. - **TypeError** - `axis` 不是int。