Skip to main content

cast_data

Function cast_data 

Source
pub fn cast_data(data: &[u8], src: SrcDtype, dst: GGMLType) -> Result<Vec<u8>>
Expand description

Cast raw little-endian tensor bytes from src to dst.

Same-dtype casts are byte-for-byte passthrough. F32→BF16 truncates the mantissa (matching the existing converters); everything routed through F32 uses exact widening.