pub struct TrainableParameterContract { /* private fields */ }Available on crate feature
std only.Expand description
Exact trainable IDs, logical shapes and storage, without frozen weight values.
Implementations§
Source§impl TrainableParameterContract
impl TrainableParameterContract
Sourcepub fn capture<B: AutodiffBackend, M: AutodiffModule<B>>(
model: &M,
) -> Result<Self, RecorderError>
pub fn capture<B: AutodiffBackend, M: AutodiffModule<B>>( model: &M, ) -> Result<Self, RecorderError>
Capture actual trainable metadata once per tied ID; no tensor values are read.
Sourcepub fn validate_for<B: AutodiffBackend, M: AutodiffModule<B>>(
&self,
model: &M,
) -> Result<(), RecorderError>
pub fn validate_for<B: AutodiffBackend, M: AutodiffModule<B>>( &self, model: &M, ) -> Result<(), RecorderError>
Match original trainable IDs/dtypes after the caller’s model-state restoration.
Sourcepub fn parameters(&self) -> usize
pub fn parameters(&self) -> usize
Actual unique trainable parameter count, not the total base-model size.
Trait Implementations§
Source§impl Clone for TrainableParameterContract
impl Clone for TrainableParameterContract
Source§impl Debug for TrainableParameterContract
impl Debug for TrainableParameterContract
Source§impl<'de> Deserialize<'de> for TrainableParameterContract
impl<'de> Deserialize<'de> for TrainableParameterContract
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TrainableParameterContract
Source§impl<B: Backend> Record<B> for TrainableParameterContract
impl<B: Backend> Record<B> for TrainableParameterContract
Source§type Item<S: PrecisionSettings> = TrainableParameterContract
type Item<S: PrecisionSettings> = TrainableParameterContract
Type of the item that can be serialized and deserialized.
Source§fn into_item<S: PrecisionSettings>(self) -> Self
fn into_item<S: PrecisionSettings>(self) -> Self
Convert the current record into the corresponding item that follows the given settings.
Source§fn from_item<S: PrecisionSettings>(item: Self, _device: &B::Device) -> Self
fn from_item<S: PrecisionSettings>(item: Self, _device: &B::Device) -> Self
Convert the given item into a record.
impl StructuralPartialEq for TrainableParameterContract
Auto Trait Implementations§
impl Freeze for TrainableParameterContract
impl RefUnwindSafe for TrainableParameterContract
impl Send for TrainableParameterContract
impl Sync for TrainableParameterContract
impl Unpin for TrainableParameterContract
impl UnsafeUnpin for TrainableParameterContract
impl UnwindSafe for TrainableParameterContract
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.