Skip to contents

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

Usage

nv_abs(x)

Arguments

x

(arrayish)
Input array.

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} ]