pub struct Applier<B: Backend> { /* private fields */ }Expand description
Applier that applies tensor snapshots to module parameters with proper adapter support using container type information
Implementations§
Source§impl<B: Backend> Applier<B>
impl<B: Backend> Applier<B>
Sourcepub fn new(
views: Vec<TensorSnapshot>,
filter: Option<PathFilter>,
adapter: Option<Box<dyn ModuleAdapter>>,
skip_enum_variants: bool,
) -> Self
pub fn new( views: Vec<TensorSnapshot>, filter: Option<PathFilter>, adapter: Option<Box<dyn ModuleAdapter>>, skip_enum_variants: bool, ) -> Self
Create a new applier with snapshots, optional filter, and optional adapter
§Arguments
views- A vector of TensorSnapshot objects to applyfilter- An optionalPathFilterto determine which tensors to apply. WhenNone, all available tensors are applied.adapter- Optional adapter to transform tensors based on container typesskip_enum_variants- Skip enum variant names when matching paths
Sourcepub fn into_result(self) -> ApplyResult
pub fn into_result(self) -> ApplyResult
Convert the applier into a result
Trait Implementations§
Source§impl<B: Backend> ModuleMapper<B> for Applier<B>
impl<B: Backend> ModuleMapper<B> for Applier<B>
Source§fn enter_module(&mut self, name: &str, container_type: &str)
fn enter_module(&mut self, name: &str, container_type: &str)
Called when entering a submodule. Read more
Source§fn exit_module(&mut self, _name: &str, container_type: &str)
fn exit_module(&mut self, _name: &str, container_type: &str)
Called when exiting a submodule. Read more
Source§fn map_float<const D: usize>(
&mut self,
param: Param<Tensor<B, D>>,
) -> Param<Tensor<B, D>>
fn map_float<const D: usize>( &mut self, param: Param<Tensor<B, D>>, ) -> Param<Tensor<B, D>>
Map a float parameter in the module. Read more
Auto Trait Implementations§
impl<B> Freeze for Applier<B>
impl<B> !RefUnwindSafe for Applier<B>
impl<B> !Send for Applier<B>
impl<B> !Sync for Applier<B>
impl<B> Unpin for Applier<B>where
B: Unpin,
impl<B> !UnwindSafe for Applier<B>
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