pub struct Applier { /* private fields */ }Expand description
学習済みモデルの適用を担当
Implementations§
Source§impl Applier
impl Applier
Sourcepub fn new(config: ApplierConfig, applicator: Arc<dyn ModelApplicator>) -> Self
pub fn new(config: ApplierConfig, applicator: Arc<dyn ModelApplicator>) -> Self
新しい Applier を作成
Sourcepub fn config(&self) -> &ApplierConfig
pub fn config(&self) -> &ApplierConfig
設定を取得
Sourcepub async fn apply(
&mut self,
model: &TrainedModel,
) -> Result<ApplyResult, ApplierError>
pub async fn apply( &mut self, model: &TrainedModel, ) -> Result<ApplyResult, ApplierError>
モデルを適用(設定に応じて、非同期)
Sourcepub async fn apply_now(
&mut self,
model: &TrainedModel,
) -> Result<ApplyResult, ApplierError>
pub async fn apply_now( &mut self, model: &TrainedModel, ) -> Result<ApplyResult, ApplierError>
モデルを即座に適用(モード関係なく、非同期)
Sourcepub async fn rollback(&self) -> Result<(), ApplierError>
pub async fn rollback(&self) -> Result<(), ApplierError>
前のモデルにロールバック(非同期)
Sourcepub fn current_model(&self) -> Option<TrainedModel>
pub fn current_model(&self) -> Option<TrainedModel>
現在適用中のモデルを取得
Auto Trait Implementations§
impl Freeze for Applier
impl !RefUnwindSafe for Applier
impl Send for Applier
impl Sync for Applier
impl Unpin for Applier
impl !UnwindSafe for Applier
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> 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