readKeyStorage

abstract fun readKeyStorage(layer: Int, startPos: Int = 0, endPos: Int = currentSeqLen): TensorStorage(source)

Read raw (possibly compressed) key storage for a layer as TensorStorage.

This is the zero-copy path for backends that can fuse dequantization with attention computation. Returns storage with the cache's native keyEncoding.

Parameters

layer

Layer index

startPos

First token position (inclusive)

endPos

Last token position (exclusive)