Skip to contents

Element-wise exponential.

Usage

prim_exp(x)

Arguments

x

(arrayish)
One input. Can be any float data type. An R value materializes at its default data type.

Value

(arrayish)
Has the input's shape and data type.

Implemented Rules

  • stablehlo

  • quickr

  • reverse

StableHLO

Lowers to hlo_exponential(), specified under exponential.

See also

Examples

# the input's data type carries through
x <- nv_array(c(0, 1, 2))
prim_exp(x)
#> AnvlArray
#>  1.0000
#>  2.7183
#>  7.3891
#> [ CPUf32{3} ] 

# an R value materializes at its default data type
prim_exp(1)
#> AnvlArray
#>  2.7183
#> [ CPUf32{} ]