ModuloCheckpointKeeper

class ModuloCheckpointKeeper(divisor: int = 10)[source]

Bases: CheckpointKeeper

Keep checkpoints if the step is divisible by a number.

Attributes Summary

divisor

Methods Summary

__call__(steps)

Iterate over the steps for which checkpoints should be kept.

Attributes Documentation

Parameters:

divisor (int)

divisor: int = 10

Methods Documentation

__call__(steps: Sequence[int]) Iterator[int][source]

Iterate over the steps for which checkpoints should be kept.

Parameters:

steps (Sequence[int]) – the sorted list of steps at which checkpoints were written.

Yields:

the steps for which checkpoints should be kept

Return type:

Iterator[int]