pub trait Optimizer {
type Device: Device;
// Required methods
fn get_lr(&self) -> f64;
fn set_lr(&mut self, lr: f64);
fn step(&mut self, grads: &GradStore<Self::Device>) -> Result<()>;
fn state_dict(&self) -> Result<LumaPack<Self::Device>>;
fn load_state_dict(&mut self, pack: &LumaPack<Self::Device>) -> Result<()>;
}Required Associated Types§
Required Methods§
fn get_lr(&self) -> f64
fn set_lr(&mut self, lr: f64)
fn step(&mut self, grads: &GradStore<Self::Device>) -> Result<()>
fn state_dict(&self) -> Result<LumaPack<Self::Device>>
fn load_state_dict(&mut self, pack: &LumaPack<Self::Device>) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".