Skip to contents

Element-wise hyperbolic tangent.

Usage

nvl_tanh(operand)

Arguments

operand

(tensorish)
Tensorish value of data type floating-point.

Value

tensorish
Has the same shape and data type as the input. It is ambiguous if the input is ambiguous.

Implemented Rules

  • stablehlo

  • backward

StableHLO

Lowers to stablehlo::hlo_tanh().

See also

Examples

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