ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

tff.program.ProgramStateManager

An interface for saving and loading program state in a federated program.

A tff.program.ProgramStateManager is used to implement fault tolerance in a federated program. The structure or type of the program state that is saved is unknown at construction time and can change as the program runs.

Methods

load

View source

Returns the saved program state for the given version.

Args
version A integer representing the version of a saved program state.

Raises
ProgramStateManagerStateNotFoundError If there is no program state for the given version.

load_latest

View source

Returns the latest saved program state and version or (None, 0).

Returns
A tuple of the latest saved (program state, version) or (None, 0) if there is no latest saved program state.

save

View source

Saves program_state for the given version.

Args
program_state The program state to save.
version A strictly increasing integer representing the version of a saved program_state.

Raises
ProgramStateManagerStateAlreadyExistsError If there is already program state for the given version.

versions

View source

Returns a list of saved versions or None.

Returns
A list of saved versions or None if there is no saved program state.