Returns a new tensor with the truncated integer values of the elements of x.

tch_trunc(x)

Arguments

x

tensor object

Examples

x <- tensor(array(runif(8), dim = c(2,2,2))) tch_trunc(x)
#> tensor #> (1,.,.) = #> 0 0 #> 0 0 #> #> (2,.,.) = #> 0 0 #> 0 0 #> [ Variable[CPUFloatType]{2,2,2} ]