def q8_byte

bendtorch@1.3.0.0 · dtype.bend:319

import bendtorch@1.3.0.0/dtype.bend as Dtype
import Base

319# an integer -127..127 (as an F32) to its two's complement byte, and back
320def q8_byte(+q: F32) -> U32:
321  ((F32.to_u32((q + 128.0 : F32)) + 128 : U32) .&. 255 : U32)

Uses (6)

Used by (1)