R/tensor.R
tch_sign.Rd
Returns a new tensor with the sign of the elements of x.
tch_sign(x)
tensor object
x <- tensor(matrix(rnorm(6), nrow = 3)) tch_sign(x)#> tensor #> 1 1 #> -1 -1 #> 1 -1 #> [ Variable[CPUFloatType]{3,2} ]