Skip to main content

Module weights

Module weights 

Source
Expand description

Initializer weight resolution: inline data and external mmap (§19.2, §12).

Turns each TensorProto initializer into an onnx_runtime_ir::WeightRef descriptor that the IR stores. Inline tensors keep their bytes; external tensors are described by (path, offset, length) and the referenced files are memory-mapped so downstream consumers get zero-copy access via WeightStore::bytes.

Structs§

WeightStore
A resolved set of initializer weights, keyed by the value they populate, plus the live memory maps backing any external data files.

Functions§

load_weights
Resolve all initializers, memory-mapping external data relative to model_dir. name_map maps initializer names to the graph value ids created by the graph_builder.