Converts the elements of an array to a different data type.
An R value in the target's category (an R integer at i8, say) is
materialized at the target directly and checked for out-of-range or missing
values. Any other R value (e.g. an R double at an integer data type) is built
at f64, i32 or bool according to its storage type and converted like an
array, without that check.
Arguments
- x
(
arrayish)
One input. Can be any data type. An R value materializes at its default data type.- dtype
(
character(1)|DataType)
Target data type. Can be any data type; the conversion is a value conversion, so it may lose precision or wrap around.
Value
(arrayish)
Has the given dtype and the input's shape.
StableHLO
Lowers to hlo_convert(), specified under
convert.