Skip to contents

Element-wise logical AND. You can also use the & operator.

Usage

nv_and(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_and() for the underlying primitive.

Examples

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