pub enum LoadStrategy {
File,
Embedded,
Bytes,
None,
}Expand description
Controls how model weights are loaded at runtime.
This determines which constructors are generated on the Model struct.
from_bytes() is generated for all variants except None.
Variants§
File
Keep weights in a separate .bpk file. Generates from_file(), from_bytes(),
and a Default impl that calls from_file().
Embedded
Embed weights in the binary via include_bytes!. Generates from_embedded(),
from_bytes(), and a Default impl that calls from_embedded().
Bytes
No built-in file or embedded loading. Generates only from_bytes().
The caller must provide weight bytes at runtime.
None
No weight-loading constructors at all.
Trait Implementations§
Source§impl Clone for LoadStrategy
impl Clone for LoadStrategy
Source§fn clone(&self) -> LoadStrategy
fn clone(&self) -> LoadStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoadStrategy
impl Debug for LoadStrategy
Source§impl Default for LoadStrategy
impl Default for LoadStrategy
Source§fn default() -> LoadStrategy
fn default() -> LoadStrategy
Returns the “default value” for a type. Read more
Source§impl PartialEq for LoadStrategy
impl PartialEq for LoadStrategy
impl Copy for LoadStrategy
impl Eq for LoadStrategy
impl StructuralPartialEq for LoadStrategy
Auto Trait Implementations§
impl Freeze for LoadStrategy
impl RefUnwindSafe for LoadStrategy
impl Send for LoadStrategy
impl Sync for LoadStrategy
impl Unpin for LoadStrategy
impl UnsafeUnpin for LoadStrategy
impl UnwindSafe for LoadStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.