Performs logical AND along the specified dimensions.
Usage
prim_reduce_all(operand, dims, drop = TRUE)
Arguments
- operand
(arrayish)
Arrayish value of boolean data type.
- dims
(integer())
Dimensions to reduce over.
- drop
(logical(1))
Whether to drop the reduced dimensions from the output shape.
If TRUE, the reduced dimensions are removed.
If FALSE, the reduced dimensions are set to 1.
Value
arrayish
Boolean array. Never ambiguous.
When drop = TRUE, the shape is that of operand with dims removed.
When drop = FALSE, the shape is that of operand with dims set to 1.
Examples
x <- nv_array(matrix(c(TRUE, FALSE, TRUE, TRUE), nrow = 2))
prim_reduce_all(x, dims = 1L)
#> AnvlArray
#> 0
#> 1
#> [ CPUbool{2} ]