Skip to contents

Element-wise reciprocal square root.

Usage

prim_rsqrt(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

  • reverse

StableHLO

Lowers to hlo_rsqrt(), specified under rsqrt.

See also

Examples

# the input's data type carries through
x <- nv_array(c(1, 4, 9))
prim_rsqrt(x)
#> AnvlArray
#>  1.0000
#>  0.5000
#>  0.3333
#> [ CPUf32{3} ] 

# an R value materializes at its default data type
prim_rsqrt(4)
#> AnvlArray
#>  0.5000
#> [ CPUf32{} ]