Skip to contents

Negates a tensor element-wise. You can also use the unary - operator.

Usage

nv_negate(operand)

Arguments

operand

(tensorish)
Operand.

Value

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

See also

nvl_negate() for the underlying primitive.

Examples

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