Reinterprets the bits of an array as a different data type without modifying the underlying data. If the target type is narrower, an extra trailing dimension is added; if wider, the last dimension is consumed.
Arguments
- operand
(
arrayish)
Operand.- dtype
(
character(1)|tengen::DataType)
Target data type.
Value
arrayish
Has the given dtype.
See also
prim_bitcast_convert() for the underlying primitive, nv_convert()
for value-preserving type conversion.
Examples
x <- nv_array(1L)
prim_bitcast_convert(x, dtype = "i8")
#> AnvlArray
#> 1 0 0 0
#> [ CPUi8{1,4} ]