Skip to contents

Element-wise rounding. You can also use the round() generic.

Usage

nv_round(operand, method = "nearest_even")

Arguments

operand

(tensorish)
Operand.

method

(character(1))
Rounding method. Either "nearest_even" (default) or "afz" (away from zero).

Value

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

See also

nvl_round() for the underlying primitive.

Examples

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