Returns a new tensor with the hyperbolic tangent of the elements of input.

tch_tanh(x)

Arguments

x

tensor object

Examples

x <- tensor(array(runif(8), dim = c(2,2,2))) tch_tanh(x)
#> tensor #> (1,.,.) = #> 0.6120 0.2054 #> 0.4020 0.0504 #> #> (2,.,.) = #> 0.0633 0.2244 #> 0.0880 0.5093 #> [ Variable[CPUFloatType]{2,2,2} ]