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

tch_cumprod(x, dim)

Arguments

x

tensor object

dim

the dimension to do the operation over

Examples

x <- tensor(1:10) tch_cumprod(x, dim = 0)
#> tensor #> 1 #> 2 #> 6 #> 24 #> 120 #> 720 #> 5040 #> 40320 #> 362880 #> 3.6288e+06 #> [ Variable[CPULongType]{10} ]