Skip to contents

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

Usage

nvl_is_finite(operand)

Arguments

operand

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

Value

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

Implemented Rules

  • stablehlo

  • backward

StableHLO

Lowers to stablehlo::hlo_is_finite().

See also

Examples

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