Skip to contents

Finds the minimum of array elements along the specified dimensions.

Usage

prim_reduce_min(operand, dims, drop = TRUE)

Arguments

operand

(arrayish)
Arrayish value of any 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
Has the same data type as the input. 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. It is ambiguous if the input is ambiguous.

Implemented Rules

  • stablehlo

  • quickr

  • reverse

StableHLO

Lowers to stablehlo::hlo_reduce() with stablehlo::hlo_minimum() as the reducer.

See also

Examples

x <- nv_array(matrix(1:6, nrow = 2))
prim_reduce_min(x, dims = 1L)
#> AnvlArray
#>  1
#>  3
#>  5
#> [ CPUi32{3} ]