pub struct OptimizerSurgeon { /* private fields */ }Expand description
Performs optimizer surgery: migrates state from one optimizer type to another.
Implementations§
Source§impl OptimizerSurgeon
impl OptimizerSurgeon
Sourcepub fn new(config: SurgeryConfig) -> Self
pub fn new(config: SurgeryConfig) -> Self
Create a new surgeon with the given migration configuration.
Sourcepub fn validate(
&self,
states: &HashMap<String, ParamStateSnapshot>,
) -> Result<(), SurgeryError>
pub fn validate( &self, states: &HashMap<String, ParamStateSnapshot>, ) -> Result<(), SurgeryError>
Validate that source states are compatible with this migration config.
Sourcepub fn migrate(
&self,
states: &HashMap<String, ParamStateSnapshot>,
) -> Result<HashMap<String, ParamStateSnapshot>, SurgeryError>
pub fn migrate( &self, states: &HashMap<String, ParamStateSnapshot>, ) -> Result<HashMap<String, ParamStateSnapshot>, SurgeryError>
Migrate state from source optimizer type to target optimizer type.
Returns new state snapshots for use with the target optimizer.
Sourcepub fn migration_report(
&self,
before: &HashMap<String, ParamStateSnapshot>,
after: &HashMap<String, ParamStateSnapshot>,
) -> MigrationReport
pub fn migration_report( &self, before: &HashMap<String, ParamStateSnapshot>, after: &HashMap<String, ParamStateSnapshot>, ) -> MigrationReport
Generate a migration summary report comparing before and after snapshots.
Auto Trait Implementations§
impl Freeze for OptimizerSurgeon
impl RefUnwindSafe for OptimizerSurgeon
impl Send for OptimizerSurgeon
impl Sync for OptimizerSurgeon
impl Unpin for OptimizerSurgeon
impl UnsafeUnpin for OptimizerSurgeon
impl UnwindSafe for OptimizerSurgeon
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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