pub struct StubWeightLoader { /* private fields */ }Expand description
Stub weight loader - MVP implementation
Implementations§
Source§impl StubWeightLoader
impl StubWeightLoader
pub fn new() -> Self
pub fn with_factory(factory: Arc<dyn TensorFactory>) -> Self
Trait Implementations§
Source§impl Debug for StubWeightLoader
impl Debug for StubWeightLoader
Source§impl Default for StubWeightLoader
impl Default for StubWeightLoader
Source§impl WeightLoader for StubWeightLoader
impl WeightLoader for StubWeightLoader
Source§fn load_tensor<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 TensorSpec,
) -> Pin<Box<dyn Future<Output = Result<TensorRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_tensor<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 TensorSpec,
) -> Pin<Box<dyn Future<Output = Result<TensorRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load tensor from weight specification
Source§fn load_tensors<'life0, 'life1, 'async_trait>(
&'life0 self,
specs: &'life1 [TensorSpec],
) -> Pin<Box<dyn Future<Output = Result<Vec<TensorRef>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_tensors<'life0, 'life1, 'async_trait>(
&'life0 self,
specs: &'life1 [TensorSpec],
) -> Pin<Box<dyn Future<Output = Result<Vec<TensorRef>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load multiple tensors at once (batch loading)
Source§fn is_available<'life0, 'life1, 'async_trait>(
&'life0 self,
_source: &'life1 WeightSource,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_available<'life0, 'life1, 'async_trait>(
&'life0 self,
_source: &'life1 WeightSource,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if weight source is available
Source§fn get_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
_source: &'life1 WeightSource,
) -> Pin<Box<dyn Future<Output = Result<WeightMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
_source: &'life1 WeightSource,
) -> Pin<Box<dyn Future<Output = Result<WeightMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get metadata about weight source
Source§fn preload<'life0, 'life1, 'async_trait>(
&'life0 self,
_source: &'life1 WeightSource,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn preload<'life0, 'life1, 'async_trait>(
&'life0 self,
_source: &'life1 WeightSource,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Preload weights into cache/memory
Source§fn capabilities(&self) -> WeightLoaderCapabilities
fn capabilities(&self) -> WeightLoaderCapabilities
Get loader capabilities
Auto Trait Implementations§
impl Freeze for StubWeightLoader
impl !RefUnwindSafe for StubWeightLoader
impl Send for StubWeightLoader
impl Sync for StubWeightLoader
impl Unpin for StubWeightLoader
impl UnsafeUnpin for StubWeightLoader
impl !UnwindSafe for StubWeightLoader
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more