Skip to contents

Element-wise equality comparison. You can also use the == operator.

Usage

nv_eq(lhs, rhs)

Arguments

lhs, rhs

(tensorish)
Left and right operand. Operands are promoted to a common data type. Scalars are broadcast to the shape of the other operand.

Value

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

See also

nvl_eq() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(1, 2, 3))
  y <- nv_tensor(c(1, 3, 2))
  x == y
})
#> AnvilTensor
#>  1
#>  0
#>  0
#> [ CPUi1{3} ]