Skip to contents

Element-wise logistic sigmoid: 1 / (1 + exp(-x)).

Usage

nvl_logistic(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_logistic().

See also

Examples

jit_eval({
  x <- nv_tensor(c(-2, 0, 2))
  nvl_logistic(x)
})
#> AnvilTensor
#>  0.1192
#>  0.5000
#>  0.8808
#> [ CPUf32{3} ]