Returns absolute values of tensor elements.

tch_abs(x)

Arguments

x

tensor object

Examples

x <- tensor(c(-1,1)) tch_abs(x)
#> tensor #> 1 #> 1 #> [ Variable[CPUFloatType]{2} ]