QuantizedTensorFactoryJvm
JVM extensions for QuantizedTensorFactory that produce MemorySegment-backed quantized tensor data for SIMD-friendly access patterns.
Usage:
val arena = Arena.ofShared()
val rawTensor: Tensor<Int8, Byte> = ... // loaded with RAW_BYTES policy
val q8Data = rawTensor.toQ8_0MemSeg(logicalShape, arena)
val q4Data = rawTensor.toQ4_0MemSeg(logicalShape, arena)Content copied to clipboard
Properties
Functions
Link copied to clipboard
Check if a quantization type supports MemorySegment-backed tensor data.
Link copied to clipboard
fun toQ4_0MemSeg(rawTensor: Tensor<Int8, Byte>, logicalShape: Shape, arena: Arena): Q4MemorySegmentTensorData
Convert a raw byte tensor to Q4_0 MemorySegment-backed data.
Link copied to clipboard
fun toQ8_0MemSeg(rawTensor: Tensor<Int8, Byte>, logicalShape: Shape, arena: Arena): Q8MemorySegmentTensorData
Convert a raw byte tensor to Q8_0 MemorySegment-backed data.