View source on GitHub
|
A tff.program.ReleaseManager that releases values to a file system.
Inherits From: ReleaseManager
tff.program.SavedModelFileReleaseManager(
root_dir: Union[str, os.PathLike[str]], prefix: str = 'release_'
)
A tff.program.SavedModelFileReleaseManager is a utility for releasing values
from a federated program to a file system and is used to release values from
platform storage to customer storage in a federated program.
Values are released to the file system using the SavedModel (see
tf.saved_model) format. When the value is released, each
tff.program.MaterializableValueReference is materialized. The structure of
the value is discarded.
See https://www.tensorflow.org/guide/saved_model for more information about the SavedModel format.
Args | |
|---|---|
root_dir
|
A path on the file system to save program state. If this path does not exist it will be created. |
prefix
|
A string to use as the prefix for filenames. |
Raises | |
|---|---|
ValueError
|
If root_dir is an empty string.
|
Methods
get_value
get_value(
key
) -> tff.program.ReleasableStructure
Returns the value for the given key.
| Args | |
|---|---|
key
|
Used to reference the released value.
|
| Returns | |
|---|---|
A retrieved value matching structure.
|
| Raises | |
|---|---|
ReleasedValueNotFoundError
|
If there is no released value for the given
key.
|
release
release(
value, key
)
Releases value from a federated program.
| Args | |
|---|---|
value
|
A tff.program.ReleasableStructure to release.
|
key
|
Used to reference (in the file system) the released value.
|
View source on GitHub