Performs logical AND along the specified axes.
Value
(arrayish)
Has the boolean data type. The shape is the input's with the reduced axes
removed (drop = TRUE) or set to 1 (drop = FALSE).
StableHLO
Lowers to hlo_reduce(), specified under
reduce.
The reducer is hlo_and().
Examples
x <- nv_matrix(c(TRUE, FALSE, TRUE, TRUE), nrow = 2)
# TRUE where every element is TRUE along axis 1
prim_reduce_all(x, axes = 1L)
#> AnvlArray
#> 0
#> 1
#> [ CPUbool{2} ]
# drop = FALSE keeps the reduced axis at size 1 instead
prim_reduce_all(x, axes = 1L, drop = FALSE)
#> AnvlArray
#> 0 1
#> [ CPUbool{1,2} ]