helion.language.cumsum
- helion.language.cumsum(input_tensor, dim, reverse=False)[source]
Compute the cumulative sum along a specified dimension.
Equivalent to
hl.associative_scan(torch.add, input_tensor, dim, reverse)
.- Parameters:
- Returns:
Tensor with same shape as input containing cumulative sum
- Return type:
See also
associative_scan()
: For custom scan operationscumprod()
: For cumulative productreduce()
: For dimension-reducing operations
Note
Output has same shape as input
Reverse=True computes cumsum from right to left
Equivalent to torch.cumsum