klyn.math.nn.serialization.ModelArchive.read
method
public static read(path as Path, maxBytes as ULong = 2147483648ul) as ModelCheckpoint<T>
Description

Loads and validates all architecture, ranges and checksums before publication. Limits and expected parameter shapes are checked before tensor allocation. The returned model is independent; no existing model can be partly mutated.

Parameters
ParameterDescription
pathLocal KNN 1.0 file. @param maxBytes Maximum tensor bytes, default 2 GiB.
Returns

Private restored model state with current optimizer/random state.

Throws
  • ValueException for incompatible precision/operators/schema/limits.
  • IOException for truncation, corruption or failed I/O.
Example

checkpoint = ModelArchive<Float16>.read(Path("half.knn"))