pub struct ModuleParameterStats {
pub total_parameters: usize,
pub trainable_parameters: usize,
pub frozen_parameters: usize,
pub parameter_count_by_layer: HashMap<String, usize>,
}Expand description
Parameter statistics structure for module analysis
Fields§
§total_parameters: usizeTotal number of parameters (trainable + frozen)
trainable_parameters: usizeNumber of trainable parameters
frozen_parameters: usizeNumber of frozen parameters
parameter_count_by_layer: HashMap<String, usize>Parameter count by layer name
Implementations§
Source§impl ModuleParameterStats
impl ModuleParameterStats
Sourcepub fn trainable_percentage(&self) -> f32
pub fn trainable_percentage(&self) -> f32
Get the percentage of parameters that are trainable
Sourcepub fn memory_usage_bytes(&self) -> usize
pub fn memory_usage_bytes(&self) -> usize
Get memory usage estimate in bytes (assuming f32 parameters)
Sourcepub fn memory_usage_mb(&self) -> f32
pub fn memory_usage_mb(&self) -> f32
Get memory usage in MB
Trait Implementations§
Source§impl Clone for ModuleParameterStats
impl Clone for ModuleParameterStats
Source§fn clone(&self) -> ModuleParameterStats
fn clone(&self) -> ModuleParameterStats
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 moreAuto Trait Implementations§
impl Freeze for ModuleParameterStats
impl RefUnwindSafe for ModuleParameterStats
impl Send for ModuleParameterStats
impl Sync for ModuleParameterStats
impl Unpin for ModuleParameterStats
impl UnsafeUnpin for ModuleParameterStats
impl UnwindSafe for ModuleParameterStats
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<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