Skip to contents

Element-wise logical XOR.

Usage

nv_xor(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 and the promoted common data type of the inputs.

See also

nvl_xor() for the underlying primitive.

Examples

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