pub enum WeightRef {
Inline(TensorData),
External {
path: PathBuf,
offset: usize,
length: usize,
dtype: DataType,
dims: Vec<usize>,
},
}Expand description
A reference to initializer (weight) data.
Small weights may be inlined; large weights are memory-mapped from an
external file at load time (see docs/ORT2.md §12). The IR only stores the
reference; the loader/onnx-runtime-memory crate performs the mmap.
Variants§
Inline(TensorData)
Weight bytes stored inline in the model.
External
Weight bytes located in an external file at [offset, offset+length).
Implementations§
Trait Implementations§
impl StructuralPartialEq for WeightRef
Auto Trait Implementations§
impl Freeze for WeightRef
impl RefUnwindSafe for WeightRef
impl Send for WeightRef
impl Sync for WeightRef
impl Unpin for WeightRef
impl UnsafeUnpin for WeightRef
impl UnwindSafe for WeightRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more