pub struct SquareAvgState<B, const D: usize>where
B: Backend,{
pub square_avg: Tensor<B, D>,
}Expand description
SquareAvgState is to store and pass optimizer step params.
Fields§
§square_avg: Tensor<B, D>Current squared average.
Implementations§
Source§impl<B, const D: usize> SquareAvgState<B, D>where
B: Backend,
impl<B, const D: usize> SquareAvgState<B, D>where
B: Backend,
Sourcepub fn new(square_avg: Tensor<B, D>) -> SquareAvgState<B, D>
pub fn new(square_avg: Tensor<B, D>) -> SquareAvgState<B, D>
Constructs a new SquareAvgState.
Source§impl<B, const D: usize> SquareAvgState<B, D>where
B: Backend,
impl<B, const D: usize> SquareAvgState<B, D>where
B: Backend,
Sourcepub fn to_device(
self,
device: &<B as BackendTypes>::Device,
) -> SquareAvgState<B, D>
pub fn to_device( self, device: &<B as BackendTypes>::Device, ) -> SquareAvgState<B, D>
Trait Implementations§
Source§impl<B, const D: usize> Clone for SquareAvgState<B, D>
impl<B, const D: usize> Clone for SquareAvgState<B, D>
Source§fn clone(&self) -> SquareAvgState<B, D>
fn clone(&self) -> SquareAvgState<B, D>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<B, const D: usize> Record<B> for SquareAvgState<B, D>where
B: Backend,
impl<B, const D: usize> Record<B> for SquareAvgState<B, D>where
B: Backend,
Source§type Item<S: PrecisionSettings> = SquareAvgStateItem<B, D, S>
type Item<S: PrecisionSettings> = SquareAvgStateItem<B, D, S>
Type of the item that can be serialized and deserialized.
Source§fn into_item<S>(self) -> <SquareAvgState<B, D> as Record<B>>::Item<S>where
S: PrecisionSettings,
fn into_item<S>(self) -> <SquareAvgState<B, D> as Record<B>>::Item<S>where
S: PrecisionSettings,
Convert the current record into the corresponding item that follows the given settings.
Source§fn from_item<S>(
item: <SquareAvgState<B, D> as Record<B>>::Item<S>,
device: &<B as BackendTypes>::Device,
) -> SquareAvgState<B, D>where
S: PrecisionSettings,
fn from_item<S>(
item: <SquareAvgState<B, D> as Record<B>>::Item<S>,
device: &<B as BackendTypes>::Device,
) -> SquareAvgState<B, D>where
S: PrecisionSettings,
Convert the given item into a record.
Auto Trait Implementations§
impl<B, const D: usize> Freeze for SquareAvgState<B, D>where
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B, const D: usize> RefUnwindSafe for SquareAvgState<B, D>where
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B, const D: usize> Send for SquareAvgState<B, D>
impl<B, const D: usize> Sync for SquareAvgState<B, D>
impl<B, const D: usize> Unpin for SquareAvgState<B, D>where
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B, const D: usize> UnsafeUnpin for SquareAvgState<B, D>where
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
impl<B, const D: usize> UnwindSafe for SquareAvgState<B, D>where
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: 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