Expand description
LSB-first 32-bit binary matrix packing, unpacking, and compact 1-bit matmul.
Structs§
- Packed
Binary Matrix - Row-major 1-bit packed matrix with values in
{-1, +1}.
Functions§
- binary_
packer - Binarize a 2D Candle tensor (
>= 0 => +1,< 0 => -1) and pack it into(packed_i32, shape_i64)tensors matching upstreambinary_packer. - binary_
unpacker - Unpack a 2D
I32packed Candle tensor back into a{-1, +1}tensor oftarget_dtypeondevice. - pack_
i8_ slice - Pack a row-major
i8matrix containing only-1and+1intoPackedBinaryMatrix. - unpack_
i32_ slice - Unpack a raw slice of row-major 32-bit words back to
{-1, +1}Vec<i8>.