cumsum#
Compute the cumulative sum of the reduction dimensions
-
template<typename InputOperator>
__MATX_INLINE__ auto matx::cumsum(const InputOperator &a)# Compute a cumulative sum (prefix sum) of rows of a tensor
Computes an exclusive cumulative sum over rows in a tensor. For example, and input tensor of [1, 2, 3, 4] would give 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);