klyn.math.nn.quantization.DeviceQuantizedMatrix.DeviceQuantizedMatrix
constructor
public DeviceQuantizedMatrix(reader as SafetensorsReader, name as String, device as Device, buffer as Byte[] = null)
Description

Loads through a shared descriptor reader; the caller owns and closes it. The reader is seeked and must not be shared concurrently.

Parameters
ParameterDescription
readerValidated open shard.
nameTensor name.
deviceCPU/GPU selector.
bufferOptional reusable upload block shared by a checkpoint loader.
Throws
  • ValueException for incompatible metadata or shape.
Example

matrix = DeviceQuantizedMatrix(reader, "projection.weight", Device.gpu[0])