Divides two arrays element-wise.
Arguments
- lhs, rhs
(
arrayish)
Two inputs of the same data type and shape. Can be any numeric data type. R values assume the other operand's data type when it is in their data type category, and their default data type when neither operand has one.
Value
(arrayish)
Has the inputs' shape and data type.
StableHLO
Lowers to hlo_divide(), specified under
divide.
See also
nv_div(), /
Examples
# two R values: both take an R double's default data type
prim_div(10, 4)
#> AnvlArray
#> 2.5000
#> [ CPUf32{} ]
# the R value is built at the array's data type instead
prim_div(10, nv_scalar(4, "f64"))
#> AnvlArray
#> 2.5000
#> [ CPUf64{} ]