Trait burn::train::checkpoint::Checkpointer

pub trait Checkpointer<R, B>
where R: Record<B>, B: Backend,
{ // Required methods fn save(&self, epoch: usize, record: R) -> Result<(), CheckpointerError>; fn delete(&self, epoch: usize) -> Result<(), CheckpointerError>; fn restore( &self, epoch: usize, device: &<B as Backend>::Device, ) -> Result<R, CheckpointerError>; }
Expand description

The trait for checkpointer.

Required Methods§

fn save(&self, epoch: usize, record: R) -> Result<(), CheckpointerError>

Save the record.

§Arguments
  • epoch - The epoch.
  • record - The record.

fn delete(&self, epoch: usize) -> Result<(), CheckpointerError>

Delete the record at the given epoch if present.

fn restore( &self, epoch: usize, device: &<B as Backend>::Device, ) -> Result<R, CheckpointerError>

Restore the record.

§Arguments
  • epoch - The epoch.
  • device - The device used to restore the record.
§Returns

The record.

Implementors§

§

impl<FR, R, B> Checkpointer<R, B> for FileCheckpointer<FR>
where R: Record<B>, FR: FileRecorder<B>, B: Backend,

§

impl<R, B> Checkpointer<R, B> for AsyncCheckpointer<R, B>
where R: Record<B> + 'static, B: Backend,