![]() |
Casting inputs 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 for casting an array from one type to another. More... | |
Casting inputs from one type to another.
C Interface for casting 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 | will contain the values in the specified type |
| [in] | in | is the input |
| [in] | type | is the target data type af_dtype |