Skip to contents

Element-wise absolute value.

Usage

nvl_abs(operand)

Arguments

operand

(tensorish)
Tensorish value of data type signed 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_abs().

See also

Examples

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