tff.program.DelayedReleaseManager
Stay organized with collections
Save and categorize content based on your preferences.
A tff.program.ReleaseManager
that releases values after specified delay.
Inherits From: ReleaseManager
tff.program.DelayedReleaseManager(
release_manager: ReleaseManager[ReleasableStructure, Key], delay: int
)
A tff.program.DelayedReleaseManager
is a utility for releasing values in a
federated program, where releases only take place after a specified delay
count. I.e., releases from platform storage to customer storage will take
place only after a certain number of instances that the .release()
method is
called. After this delay, further calls to .release()
will release values
(in accordance with the release_manager
that was provided).
For example, in a federated program that runs for a long time, one may want to
skip releasing values until the program has run for a sufficiently long-enough
period.
The delay count is specified at construction time by setting the delay
argument (an integer). A delay
of 3
means that all values will start to be
released once release
has been invoked at least three times.
Args |
release_manager
|
A tff.program.ReleaseManager used to release values to.
|
delay
|
The delay duration before releasing values. Must be a positive
integer.
|
Raises |
ValueError
|
If delay is not positive.
|
Methods
release
View source
release(
value, key
)
Releases value
from a federated program.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-20 UTC.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.program.DelayedReleaseManager\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |\n\nA [`tff.program.ReleaseManager`](../../tff/program/ReleaseManager) that releases values after specified delay.\n\nInherits From: [`ReleaseManager`](../../tff/program/ReleaseManager) \n\n tff.program.DelayedReleaseManager(\n release_manager: ReleaseManager[ReleasableStructure, Key], delay: int\n )\n\nA [`tff.program.DelayedReleaseManager`](../../tff/program/DelayedReleaseManager) is a utility for releasing values in a\nfederated program, where releases only take place after a specified delay\ncount. I.e., releases from platform storage to customer storage will take\nplace only after a certain number of instances that the `.release()` method is\ncalled. After this delay, further calls to `.release()` will release values\n(in accordance with the `release_manager` that was provided).\n\nFor example, in a federated program that runs for a long time, one may want to\nskip releasing values until the program has run for a sufficiently long-enough\nperiod.\n\nThe delay count is specified at construction time by setting the `delay`\nargument (an integer). A `delay` of `3` means that all values will start to be\nreleased once `release` has been invoked at least three times.\n| **Note:** that a `delay` of one will release every value, making the [`tff.program.DelayedReleaseManager`](../../tff/program/DelayedReleaseManager) a noop wrapper around the `release_manager`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------------|-----------------------------------------------------------------------------------------------|\n| `release_manager` | A [`tff.program.ReleaseManager`](../../tff/program/ReleaseManager) used to release values to. |\n| `delay` | The delay duration before releasing values. Must be a positive integer. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|-----------------------------|\n| `ValueError` | If `delay` is not positive. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `release`\n\n[View source](https://github.com/tensorflow/federated/blob/v0.87.0\nVersion 2.0, January 2004\nLicensed under the Apache License, Version 2.0 (the) \n\n release(\n value, key\n )\n\nReleases `value` from a federated program.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------|------------------------------------------------------------------------------------------|\n| `value` | A [`tff.program.ReleasableStructure`](../../tff/program#ReleasableStructure) to release. |\n| `key` | A value used to reference the released `value`. |\n\n\u003cbr /\u003e"]]