Skip to contents

Element-wise absolute value. You can also use abs().

Usage

nv_abs(operand)

Arguments

operand

(tensorish)
Operand.

Value

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

See also

nvl_abs() for the underlying primitive.

Examples

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