Skip to contents

Element-wise sign function. You can also use sign().

Usage

nv_sign(operand)

Arguments

operand

(arrayish)
Operand.

Value

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

See also

prim_sign() for the underlying primitive.

Examples

x <- nv_array(c(-3, 0, 5))
sign(x)
#> AnvlArray
#>  -1
#>   0
#>   1
#> [ CPUf32{3} ]