Skip to contents

Element-wise hyperbolic tangent. You can also use tanh().

Usage

nv_tanh(operand)

Arguments

operand

(tensorish)
Operand.

Value

tensorish
Has the same shape and data type as the input.

See also

nvl_tanh() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(-1, 0, 1))
  tanh(x)
})
#> AnvilTensor
#>  -0.7616
#>   0.0000
#>   0.7616
#> [ CPUf32{3} ]