pub struct WeightStore {
pub weights: HashMap<ValueId, WeightRef>,
/* private fields */
}Expand description
A resolved set of initializer weights, keyed by the value they populate, plus the live memory maps backing any external data files.
Fields§
§weights: HashMap<ValueId, WeightRef>IR weight descriptors, keyed by the graph value they initialize.
Implementations§
Source§impl WeightStore
impl WeightStore
Sourcepub fn bytes<'a>(&'a self, weight: &'a WeightRef) -> Option<&'a [u8]>
pub fn bytes<'a>(&'a self, weight: &'a WeightRef) -> Option<&'a [u8]>
Resolve a weight descriptor to its raw little-endian bytes.
For inline weights this borrows the stored bytes; for external weights
it slices into the memory-mapped file. Returns None if an external
mapping is missing or the [offset, offset+length) window is out of
bounds.
Trait Implementations§
Source§impl Debug for WeightStore
impl Debug for WeightStore
Source§impl Default for WeightStore
impl Default for WeightStore
Source§fn default() -> WeightStore
fn default() -> WeightStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WeightStore
impl RefUnwindSafe for WeightStore
impl Send for WeightStore
impl Sync for WeightStore
impl Unpin for WeightStore
impl UnsafeUnpin for WeightStore
impl UnwindSafe for WeightStore
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