pub struct LocalGradientSync;Expand description
No-op gradient sync for single-node / single-threaded training.
sync_gradients is a pure identity operation; it leaves the gradient
array untouched and never allocates.
Implementations§
Trait Implementations§
Source§impl Clone for LocalGradientSync
impl Clone for LocalGradientSync
Source§fn clone(&self) -> LocalGradientSync
fn clone(&self) -> LocalGradientSync
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 moreSource§impl Debug for LocalGradientSync
impl Debug for LocalGradientSync
Source§impl Default for LocalGradientSync
impl Default for LocalGradientSync
Source§fn default() -> LocalGradientSync
fn default() -> LocalGradientSync
Returns the “default value” for a type. Read more
Source§impl GradientSync for LocalGradientSync
impl GradientSync for LocalGradientSync
Source§fn sync_gradients(&self, _gradients: &mut Array1<f32>) -> ModelResult<()>
fn sync_gradients(&self, _gradients: &mut Array1<f32>) -> ModelResult<()>
Synchronize (aggregate) gradients across all workers. Read more
Source§fn is_distributed(&self) -> bool
fn is_distributed(&self) -> bool
Returns
true if this sync implementation involves multiple workers.Source§fn num_workers(&self) -> usize
fn num_workers(&self) -> usize
Number of workers participating in synchronization.
Auto Trait Implementations§
impl Freeze for LocalGradientSync
impl RefUnwindSafe for LocalGradientSync
impl Send for LocalGradientSync
impl Sync for LocalGradientSync
impl Unpin for LocalGradientSync
impl UnsafeUnpin for LocalGradientSync
impl UnwindSafe for LocalGradientSync
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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