UnionCheckpointKeeper

class UnionCheckpointKeeper(bases: str | CheckpointKeeper | type[CheckpointKeeper] | None | Sequence[str | CheckpointKeeper | type[CheckpointKeeper] | None], bases_kwargs: Mapping[str, Any] | None | Sequence[Mapping[str, Any] | None] = None)[source]

Bases: CheckpointKeeper

Keep a checkpoint where one of the criteria is met.

Attributes Summary

bases_kwargs

Methods Summary

__call__(steps)

Iterate over the steps for which checkpoints should be kept.

Attributes Documentation

Parameters:
bases_kwargs: Mapping[str, Any] | None | Sequence[Mapping[str, Any] | None] = None

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]