chainer.functions.cumsum

chainer.functions.cumsum(x, axis=None)[source]

Cumulative sum of array elements over a given axis.

Parameters
  • x (Variable or N-dimensional array) – Elements to calculate the cumulative sum.

  • axis (int or None) – Axis along which the cumulative sum is taken. If it is not specified, the input is flattened.

Returns

Output variable.

Return type

Variable