Skip to contents

Element-wise greater than comparison.

Usage

prim_gt(lhs, rhs)

Arguments

lhs, rhs

(arrayish)
Two inputs of the same data type and shape. Can be any data type. R values take the other operand's data type when it is in their data type category, and their default data type when neither operand has one. An R value outside the other operand's category is an error, as are two R values of different storage types.

Value

(arrayish)
Has the inputs' shape and boolean data type.

Implemented Rules

  • stablehlo

  • quickr

  • reverse

StableHLO

Lowers to hlo_compare(), specified under compare. The comparison direction is GT.

See also

Examples

# two R values: both take an R double's default data type
prim_gt(2, 1)
#> AnvlArray
#>  1
#> [ CPUbool{} ] 

# the R value is built at the array's data type instead
prim_gt(2, nv_scalar(1, "f64"))
#> AnvlArray
#>  1
#> [ CPUbool{} ]