Cast an array from one type to another. More...
Functions | |
AFAPI af_err | af_cast (af_array *out, const af_array in, const af_dtype type) |
C Interface to cast an array from one type to another. | |
Cast an array from one type to another.
C Interface to cast an array from one type to another.
This function casts an af_array object from one type to another. If the type of the original array is the same as type
then the same array is returned.
inner-> | f32 | f64 | c32 | c64 | s32 | u32 | u8 | b8 | s64 | u64 | s16 | u16 | f16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f32 | x | x | x | x | x | ||||||||
f64 | x | x | x | x | x | ||||||||
c32 | x | x | x | x | x | ||||||||
c64 | x | x | x | x | x | ||||||||
s32 | x | x | x | x | x | x | x | x | x | ||||
u32 | x | x | x | x | x | x | x | x | x | ||||
u8 | x | x | x | x | x | x | x | x | x | x | x | x | x |
b8 | x | x | x | x | x | x | x | x | x | x | x | x | x |
s64 | x | x | x | x | x | x | x | ||||||
u64 | x | x | x | x | x | x | x | ||||||
s16 | x | x | x | x | x | x | x | x | x | x | x | ||
u16 | x | x | x | x | x | x | x | x | x | x | x | ||
f16 | x | x | x | x | x |
[out] | out | values in the specified type |
[in] | in | input |
[in] | type | target data type af_dtype |