pub type State<T = Array> = HashMap<Rc<str>, T>;Expand description
Type alias for common optimizer state.
Aliased Type§
pub struct State<T = Array> { /* private fields */ }Trait Implementations§
Source§impl OptimizerState for State<AdafactorState>
impl OptimizerState for State<AdafactorState>
Source§type UnflattenError = UnflattenError
type UnflattenError = UnflattenError
Error type for unflatten.
Source§fn state_projection(
&mut self,
) -> Result<StateProjection<'_>, StateProjectionError>
fn state_projection( &mut self, ) -> Result<StateProjection<'_>, StateProjectionError>
Declare all required and optional optimizer-state slots.
Source§fn unflatten<I, K>(input: I) -> Result<Self, Self::UnflattenError>
fn unflatten<I, K>(input: I) -> Result<Self, Self::UnflattenError>
Unflatten an iterator of key-value pairs into the optimizer state.
Source§fn flatten(&mut self) -> Result<Vec<(Rc<str>, &Array)>, StateProjectionError>
fn flatten(&mut self) -> Result<Vec<(Rc<str>, &Array)>, StateProjectionError>
Flatten present state entries in stable key order.
Source§fn flatten_mut(
&mut self,
) -> Result<Vec<(Rc<str>, &mut Array)>, StateProjectionError>
fn flatten_mut( &mut self, ) -> Result<Vec<(Rc<str>, &mut Array)>, StateProjectionError>
Flatten mutable present state entries in stable key order.
Source§impl OptimizerState for State
impl OptimizerState for State
Source§type UnflattenError = Infallible
type UnflattenError = Infallible
Error type for unflatten.
Source§fn state_projection(
&mut self,
) -> Result<StateProjection<'_>, StateProjectionError>
fn state_projection( &mut self, ) -> Result<StateProjection<'_>, StateProjectionError>
Declare all required and optional optimizer-state slots.
Source§fn unflatten<I, K>(input: I) -> Result<Self, Self::UnflattenError>
fn unflatten<I, K>(input: I) -> Result<Self, Self::UnflattenError>
Unflatten an iterator of key-value pairs into the optimizer state.
Source§fn flatten(&mut self) -> Result<Vec<(Rc<str>, &Array)>, StateProjectionError>
fn flatten(&mut self) -> Result<Vec<(Rc<str>, &Array)>, StateProjectionError>
Flatten present state entries in stable key order.
Source§fn flatten_mut(
&mut self,
) -> Result<Vec<(Rc<str>, &mut Array)>, StateProjectionError>
fn flatten_mut( &mut self, ) -> Result<Vec<(Rc<str>, &mut Array)>, StateProjectionError>
Flatten mutable present state entries in stable key order.
Source§impl OptimizerState for State<(Array, Array)>
impl OptimizerState for State<(Array, Array)>
Source§type UnflattenError = UnflattenError
type UnflattenError = UnflattenError
Error type for unflatten.
Source§fn state_projection(
&mut self,
) -> Result<StateProjection<'_>, StateProjectionError>
fn state_projection( &mut self, ) -> Result<StateProjection<'_>, StateProjectionError>
Declare all required and optional optimizer-state slots.
Source§fn unflatten<I, K>(input: I) -> Result<Self, Self::UnflattenError>
fn unflatten<I, K>(input: I) -> Result<Self, Self::UnflattenError>
Unflatten an iterator of key-value pairs into the optimizer state.
Source§fn flatten(&mut self) -> Result<Vec<(Rc<str>, &Array)>, StateProjectionError>
fn flatten(&mut self) -> Result<Vec<(Rc<str>, &Array)>, StateProjectionError>
Flatten present state entries in stable key order.
Source§fn flatten_mut(
&mut self,
) -> Result<Vec<(Rc<str>, &mut Array)>, StateProjectionError>
fn flatten_mut( &mut self, ) -> Result<Vec<(Rc<str>, &mut Array)>, StateProjectionError>
Flatten mutable present state entries in stable key order.