Skip to main content

unpack_int4

Function unpack_int4 

Source
pub fn unpack_int4(bytes: &[u8], index: usize) -> Option<i8>
Expand description

Decode one signed two’s-complement INT4 value packed low nibble first.

This returns all mechanically representable values, including -8. TOSA 1.0 tensor constants use the narrower -7..=7 range; semantic validation rejects -8 where the specification does.