f32_to_e4m3_rne

Function f32_to_e4m3_rne 

Source
pub fn f32_to_e4m3_rne(x: f32) -> u8
Expand description

Encode with round-to-nearest-even, as torch’s .to(float8_e4m3fn) does. Saturates above 448 (callers clamp first; the fixture never gets there).