Q4MemorySegmentTensorData
class Q4MemorySegmentTensorData(initialShape: Shape, val segment: MemorySegment, val segmentByteOffset: Long = 0) : TensorData<DType, Byte> , Q4MemorySegmentMarker(source)
Q4_0 quantized tensor data backed by a MemorySegment.
Q4_0 block layout (18 bytes per 32 elements):
2 bytes: f16 scale (little-endian)
16 bytes: packed 4-bit codes (32 values, 2 per byte)
Dequantization: outputi = (nibblei - 8) * scale
The segment is arena-managed and 64-byte aligned for SIMD access.
Properties
Link copied to clipboard
Number of Q4_0 blocks in the tensor.
Link copied to clipboard
Bytes per block.
Link copied to clipboard
Byte offset into segment where this tensor's data starts.