cumsum

Contents

cumsum#

Compute the cumulative sum of the reduction dimensions

Added in version 0.6.0.

template<typename InputOperator>
__MATX_INLINE__ auto matx::cumsum(const InputOperator &a)#

Compute an inclusive cumulative sum (prefix sum) along the innermost dimension

Computes an inclusive cumulative sum over the innermost dimension of a tensor. For example, an input tensor of [1, 2, 3, 4] gives the output [1, 3, 6, 10].

Template Parameters:

InputOperator – Input operator type

Parameters:

a – Input operator

Returns:

operator with cumulative sum

Examples#

// Compute the cumulative sum/exclusive scan across "t1"
(tmpv = cumsum(this->t1)).run(this->exec);