sum

tch_sum(x, dim = NULL, keepdim = FALSE)

Arguments

x

tensor object

dim

dimension in which to sum

keepdim

wether to keep or not the dim

dtype

optionaly cast the sum result

Examples

x <- tensor(1:10) tch_sum(x)
#> tensor #> 55 #> [ Variable[CPULongType]{} ]