dequantizeRow method

void dequantizeRow(
  1. int r,
  2. Float32List out,
  3. int offset
)

Writes row r, dequantized, into out at offset: token lookup in an embedding that exists only as the tied, quantized LM head.

Implementation

void dequantizeRow(int r, Float32List out, int offset) {
  // Keep lookup on direct pointers: temporary external typed views crashed
  // in the CPU-to-GPU cache reload regression under the Dart 3.13.5 JIT.
  final start = r * cols;
  for (var c = 0; c < cols; c++) {
    out[offset + c] = _qs[start + c] * _scales[(start + c) >> 5];
  }
}