Returns the cumulative sum of elements of input in the dimension dim.

tch_cumsum(x, dim)

Arguments

x

tensor object

dim

the dimension to do the operation over

Examples

x <- tensor(1:10) tch_cumsum(x, dim = 0)
#> tensor #> 1 #> 3 #> 6 #> 10 #> 15 #> 21 #> 28 #> 36 #> 45 #> 55 #> [ Variable[CPULongType]{10} ]