Skip to contents

Element-wise natural logarithm.

Usage

prim_log(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_log(), specified under log.

See also

Examples

# the input's data type carries through
x <- nv_array(c(1, 2.718, 7.389))
prim_log(x)
#> AnvlArray
#>  0.0000
#>  0.9999
#>  2.0000
#> [ CPUf32{3} ] 

# an R value materializes at its default data type
prim_log(2)
#> AnvlArray
#>  0.6931
#> [ CPUf32{} ]