Skip to contents

Element-wise check if values are finite (not Inf, -Inf, or NaN).

Usage

nv_is_finite(operand)

Arguments

operand

(tensorish)
Operand.

Value

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

See also

nvl_is_finite() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(1, Inf, NaN, -Inf, 0))
  nv_is_finite(x)
})
#> AnvilTensor
#>  1
#>  0
#>  0
#>  0
#>  1
#> [ CPUi1{5} ]