pub enum WeightSource<'a> {
Bytes(&'a [u8]),
File(&'a Path),
Reader(&'a DataReader),
}Expand description
Where a network reads its weights from.
Weights have no text form, so a string source names a file.
Variants§
Bytes(&'a [u8])
Weight bytes in declaration order.
File(&'a Path)
A file the native stdio loader opens.
Reader(&'a DataReader)
A reader that owns its bytes or file.
Implementations§
Source§impl WeightSource<'_>
impl WeightSource<'_>
Sourcepub const EMPTY: WeightSource<'static>
pub const EMPTY: WeightSource<'static>
No weights, which is what a graph whose layers need none loads.
Trait Implementations§
Source§impl<'a> From<&'a DataReader> for WeightSource<'a>
impl<'a> From<&'a DataReader> for WeightSource<'a>
Source§fn from(reader: &'a DataReader) -> Self
fn from(reader: &'a DataReader) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a Path> for WeightSource<'a>
impl<'a> From<&'a Path> for WeightSource<'a>
Source§impl<'a> From<&'a PathBuf> for WeightSource<'a>
impl<'a> From<&'a PathBuf> for WeightSource<'a>
Source§impl<'a> From<&'a [u8]> for WeightSource<'a>
impl<'a> From<&'a [u8]> for WeightSource<'a>
Auto Trait Implementations§
impl<'a> !Send for WeightSource<'a>
impl<'a> !Sync for WeightSource<'a>
impl<'a> Freeze for WeightSource<'a>
impl<'a> RefUnwindSafe for WeightSource<'a>
impl<'a> Unpin for WeightSource<'a>
impl<'a> UnsafeUnpin for WeightSource<'a>
impl<'a> UnwindSafe for WeightSource<'a>
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