pub struct GradientAccumulator<T> { /* private fields */ }Expand description
Gradient accumulator for managing accumulated gradients
Implementations§
Source§impl<T: Clone> GradientAccumulator<T>
impl<T: Clone> GradientAccumulator<T>
pub fn new(config: AccumulationConfig) -> Self
Sourcepub fn accumulate(&mut self, gradients: Vec<T>)
pub fn accumulate(&mut self, gradients: Vec<T>)
Add gradients to accumulator
pub fn config(&self) -> &AccumulationConfig
Auto Trait Implementations§
impl<T> Freeze for GradientAccumulator<T>
impl<T> RefUnwindSafe for GradientAccumulator<T>where
T: RefUnwindSafe,
impl<T> Send for GradientAccumulator<T>where
T: Send,
impl<T> Sync for GradientAccumulator<T>where
T: Sync,
impl<T> Unpin for GradientAccumulator<T>where
T: Unpin,
impl<T> UnwindSafe for GradientAccumulator<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