Skip to contents

Element-wise absolute value. You can also use abs().

Usage

nv_abs(operand)

Arguments

operand

(arrayish)
Operand.

Value

arrayish
Has the same shape and data type as the input.

See also

prim_abs() for the underlying primitive.

Examples

x <- nv_array(c(-1, 2, -3))
abs(x)
#> AnvlArray
#>  1
#>  2
#>  3
#> [ CPUf32{3} ]