Skip to contents

Performs logical AND along the specified axes.

Usage

prim_reduce_all(x, axes, drop = TRUE)

Arguments

x

(arrayish)
Arrayish value of boolean data type.

axes

(integer())
Axes to reduce over. Negative values count from the end, i.e. -1 refers to the last axis.

drop

(logical(1))
Whether to drop the reduced axes from the output shape. If TRUE, the reduced axes are removed. If FALSE, the reduced axes are set to 1.

Value

arrayish
Boolean array. Never ambiguous. When drop = TRUE, the shape is that of x with axes removed. When drop = FALSE, the shape is that of x with axes set to 1.

Implemented Rules

  • stablehlo

  • quickr

  • reverse

StableHLO

Lowers to hlo_reduce() with hlo_and() as the reducer.

See also

Examples

x <- nv_matrix(c(TRUE, FALSE, TRUE, TRUE), nrow = 2)
prim_reduce_all(x, axes = 1L)
#> AnvlArray
#>  0
#>  1
#> [ CPUbool{2} ]