Skip to contents

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 axis is added; if wider, the last axis is consumed.

Usage

nv_bitcast_convert(x, dtype)

Arguments

x

(arrayish)
Input array.

dtype

(character(1) | 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} ]