Skip to contents

Negates a tensor element-wise.

Usage

nvl_negate(operand)

Arguments

operand

(tensorish)
Tensorish value of data type integer or floating-point.

Value

tensorish
Has the same shape and data type as the input. It is ambiguous if the input is ambiguous.

Implemented Rules

  • stablehlo

  • backward

StableHLO

Lowers to stablehlo::hlo_negate().

See also

nv_negate(), unary -

Examples

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