Returns a new tensor with each of the elements of x rounded to the closest integer.

tch_round(x)

Arguments

x

tensor object

Examples

x <- tensor(matrix(runif(6), nrow = 3)) tch_round(x)
#> tensor #> 1 1 #> 0 1 #> 0 1 #> [ Variable[CPUFloatType]{3,2} ]