Skip to contents

Performs logical OR along the specified dimensions. Returns TRUE if any element is TRUE.

Usage

nv_reduce_any(operand, dims, drop = TRUE)

Arguments

operand

(tensorish)
Operand.

dims

(integer())
Dimensions to reduce.

drop

(logical(1))
Whether to drop reduced dimensions.

Value

tensorish
Boolean tensor. When drop = TRUE, the reduced dimensions are removed. When drop = FALSE, the reduced dimensions are set to 1.

See also

nvl_reduce_any() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(matrix(c(TRUE, FALSE, TRUE, TRUE), nrow = 2))
  nv_reduce_any(x, dims = 1L)
})
#> AnvilTensor
#>  1
#>  1
#> [ CPUi1{2} ]