Skip to contents

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

Usage

nv_sign(operand)

Arguments

operand

(tensorish)
Operand.

Value

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

See also

nvl_sign() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(-3, 0, 5))
  sign(x)
})
#> AnvilTensor
#>  -1
#>   0
#>   1
#> [ CPUf32{3} ]