Q8_0BlockTensorData

Implementation of Q8_0TensorData backed by a packed byte array.

Memory layout per block:

  • bytes 0..1: f16 scale (little-endian)

  • bytes 2..33: 32 int8 quantized codes

Parameters

initialShape

the logical shape of the tensor (in elements, not blocks)

packedData

the raw packed block data

Constructors

Link copied to clipboard
constructor(initialShape: Shape, data: ByteArray)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val blockCount: Int

Number of Q8_0 blocks in the tensor.

Link copied to clipboard
open override val packedData: ByteArray

Raw packed data containing all blocks.

Link copied to clipboard
open override val shape: Shape

The shape descriptor that defines the dimensionality and size of this tensor data.

Functions

Link copied to clipboard
open operator override fun get(vararg indices: Int): Byte

Retrieves an element at the specified multidimensional indices.

Link copied to clipboard
open override fun getBlockScale(blockIdx: Int): Float

Get the scale factor for a specific block.

Link copied to clipboard
open override fun getCode(blockIdx: Int, elementIdx: Int): Byte

Get a quantized code value within a block (0..31).

Link copied to clipboard
open operator override fun set(vararg indices: Int, value: Byte)

Setter