Skip to contents

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

Usage

prim_logistic(operand)

Arguments

operand

(arrayish)
Arrayish value of data type floating-point.

Value

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

Implemented Rules

  • stablehlo

  • quickr

  • reverse

StableHLO

Lowers to stablehlo::hlo_logistic().

See also

Examples

x <- nv_array(c(-2, 0, 2))
prim_logistic(x)
#> AnvlArray
#>  0.1192
#>  0.5000
#>  0.8808
#> [ CPUf32{3} ]