ClikaRT::ops::cumsum
function
cumsum()
Tensor cumsum(
Tensor x,
int64_t dim,
DataType dtype = DataType::Undefined
)
Cumulative sum along dim (inclusive scan).
Output mirrors x's shape; dtype widens the accumulation/output when set (Undefined keeps x's dtype).
Parameters
x: the input tensor.dim: the axis to scan along.dtype: output dtype;Undefinedkeepsx's dtype.
Returns: the scanned tensor, same shape as x.
Throws
ClikaRT::Error: (INVALID_ARGUMENT) whendimis out of range.
auto cu = ClikaRT::ops::cumsum(lengths, 0); // prefix sums
Declared in ClikaRT/compute/ops.h, line 4549