pub struct Ignored<T>(pub T);๐Deprecated since 0.21.0:
Ignored<T> is deprecated. Use #[module(skip)] for non-persistent fields (same behavior).
Expand description
Container to satisfy the Module trait for types that are not modules.
Tuple Fieldsยง
ยง0: T๐Deprecated since 0.21.0:
Ignored<T> is deprecated. Use #[module(skip)] for non-persistent fields (same behavior).
Trait Implementationsยง
Sourceยงimpl<B, T> AutodiffModule<B> for Ignored<T>
impl<B, T> AutodiffModule<B> for Ignored<T>
Sourceยงtype InnerModule = Ignored<T>
type InnerModule = Ignored<T>
Inner module without auto-differentiation.
Sourceยงfn valid(&self) -> Self::InnerModule
fn valid(&self) -> Self::InnerModule
Returns the same module, but on the inner backend without auto-differentiation.
Sourceยงfn from_inner(module: Self::InnerModule) -> Self
fn from_inner(module: Self::InnerModule) -> Self
Wraps an inner module back into an auto-diff module.
Sourceยงimpl<B, T> Module<B> for Ignored<T>
impl<B, T> Module<B> for Ignored<T>
Sourceยงtype Record = EmptyRecord
type Record = EmptyRecord
Type to save and load the module.
Sourceยงfn visit<V: ModuleVisitor<B>>(&self, _visitor: &mut V)
fn visit<V: ModuleVisitor<B>>(&self, _visitor: &mut V)
Visit each tensor parameter in the module with a visitor.
Sourceยงfn map<M: ModuleMapper<B>>(self, _mapper: &mut M) -> Self
fn map<M: ModuleMapper<B>>(self, _mapper: &mut M) -> Self
Map each tensor parameter in the module with a mapper.
Sourceยงfn load_record(self, _record: Self::Record) -> Self
fn load_record(self, _record: Self::Record) -> Self
Load the module state from a record.
Sourceยงfn into_record(self) -> Self::Record
fn into_record(self) -> Self::Record
Convert the module into a record containing the state.
Sourceยงfn to_device(self, _: &Device<B>) -> Self
fn to_device(self, _: &Device<B>) -> Self
Move the module and all of its sub-modules to the given device. Read more
Sourceยงfn fork(self, _: &Device<B>) -> Self
fn fork(self, _: &Device<B>) -> Self
Fork the module and all of its sub-modules to the given device. Read more
Sourceยงfn collect_devices(&self, devices: Devices<B>) -> Devices<B>
fn collect_devices(&self, devices: Devices<B>) -> Devices<B>
Return all the devices found in the underneath module tree added to the given vector
without duplicates.
Sourceยงfn devices(&self) -> Devices<B>
fn devices(&self) -> Devices<B>
Return all the devices found in the underneath module tree without duplicates.
Sourceยงfn train<AB>(self) -> <Self as HasAutodiffModule<AB>>::TrainModulewhere
AB: AutodiffBackend<InnerBackend = B>,
Self: HasAutodiffModule<AB>,
fn train<AB>(self) -> <Self as HasAutodiffModule<AB>>::TrainModulewhere
AB: AutodiffBackend<InnerBackend = B>,
Self: HasAutodiffModule<AB>,
Move the module and all of its sub-modules to the autodiff backend. Read more
Sourceยงfn num_params(&self) -> usize
fn num_params(&self) -> usize
Get the number of parameters the module has, including all of its sub-modules.
Sourceยงfn save_file<FR, PB>(
self,
file_path: PB,
recorder: &FR,
) -> Result<(), RecorderError>
fn save_file<FR, PB>( self, file_path: PB, recorder: &FR, ) -> Result<(), RecorderError>
Available on crate feature
std only.Save the module to a file using the provided file recorder. Read more
Sourceยงfn load_file<FR, PB>(
self,
file_path: PB,
recorder: &FR,
device: &B::Device,
) -> Result<Self, RecorderError>
fn load_file<FR, PB>( self, file_path: PB, recorder: &FR, device: &B::Device, ) -> Result<Self, RecorderError>
Available on crate feature
std only.Load the module from a file using the provided file recorder. Read more
Sourceยงfn quantize_weights(self, quantizer: &mut Quantizer) -> Self
fn quantize_weights(self, quantizer: &mut Quantizer) -> Self
Quantize the weights of the module.
Sourceยงimpl<T> ModuleDisplay for Ignored<T>
impl<T> ModuleDisplay for Ignored<T>
Sourceยงfn format(&self, passed_settings: DisplaySettings) -> String
fn format(&self, passed_settings: DisplaySettings) -> String
Formats the module with provided display settings. Read more
Sourceยงfn custom_settings(&self) -> Option<DisplaySettings>
fn custom_settings(&self) -> Option<DisplaySettings>
Custom display settings for the module. Read more
Auto Trait Implementationsยง
impl<T> Freeze for Ignored<T>where
T: Freeze,
impl<T> RefUnwindSafe for Ignored<T>where
T: RefUnwindSafe,
impl<T> Send for Ignored<T>where
T: Send,
impl<T> Sync for Ignored<T>where
T: Sync,
impl<T> Unpin for Ignored<T>where
T: Unpin,
impl<T> UnsafeUnpin for Ignored<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Ignored<T>where
T: UnwindSafe,
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