View source on GitHub |
A tff.program.ReleaseManager
that releases values at regular intervals.
Inherits From: ReleaseManager
tff.program.PeriodicReleaseManager(
release_manager: ReleaseManager[ReleasableStructure, Key],
periodicity: Union[int, datetime.timedelta]
)
A tff.program.PeriodicReleaseManager
is a utility for releasing values at
regular intervals and is used to release values from platform storage to
customer storage in a federated program.
The interval can be controlled at construction time by setting the
periodicity
. The periodicity
can be a positive integer or
datetime.timedelta
. A periodicity
of 3
means that every third value is
released to the release_manager
, and invoking release
ten times will
release the third, sixth, and ninth values. A periodicity
of
datetime.timedelta(hours=3)
means that three hours after the previously
released value the next value is released to the release_manager
.
Args | |
---|---|
release_manager
|
A tff.program.ReleaseManager used to release values to.
|
periodicity
|
The interval to release values. Must be a positive integer or
datetime.timedelta .
|
Raises | |
---|---|
ValueError
|
If periodicity is not a positive integer or
datetime.timedelta .
|
Methods
release
release(
value, key
)
Releases value
from a federated program.
Args | |
---|---|
value
|
A tff.program.ReleasableStructure to release.
|
key
|
A value used to reference the released value .
|