tff.framework.ExecutorFactory
Stay organized with collections
Save and categorize content based on your preferences.
Interface defining executor factories.
ExecutorFactory
should be considered to own the executors it creates; it
is responsible for their instantiation and management.
ExecutorFactory
exposes two methods, create_executor
and
clean_up_executors
. There is a particular coupling between these two
methods; any executor returned by create_executor
should not be used
after clean_up_executors
has been called without reinitialization. That is,
create_executor
should be called again, and ExecutorFactory
will ensure
that the returned executor is safe for use.
Methods
clean_up_executor
View source
@abc.abstractmethod
clean_up_executor(
cardinalities: tff.framework.CardinalitiesType
)
Releases any resources associated to the given cardinalities.
Note that calling this method may invalidate the state of any executors
which have previously been returned by the factory with the cardinalities
argument ; create_executor
should be called again if a new executor which
is safe to use is desired.
Args |
cardinalities
|
The cardinalities of the executor whose state we wish to
clear.
|
create_executor
View source
@abc.abstractmethod
create_executor(
cardinalities: tff.framework.CardinalitiesType
) -> executor_base.Executor
Abstract method to construct instance of executor_base.Executor
.
create_executor
must accept a dict mapping
placements.PlacementLiterals
to ints
, and return an
executor_base.Executor
.
Args |
cardinalities
|
a dict mapping instances of placements.PlacementLiteral
to ints, specifying the population size at each placement.
|
Returns |
Instance of executor_base.Executor .
|
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.framework.ExecutorFactory\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\nInterface defining executor factories.\n\n`ExecutorFactory` should be considered to own the executors it creates; it\nis responsible for their instantiation and management.\n\n`ExecutorFactory` exposes two methods, `create_executor` and\n`clean_up_executors`. There is a particular coupling between these two\nmethods; any executor returned by `create_executor` should not be used\nafter `clean_up_executors` has been called without reinitialization. That is,\n`create_executor` should be called again, and `ExecutorFactory` will ensure\nthat the returned executor is safe for use.\n\nMethods\n-------\n\n### `clean_up_executor`\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 @abc.abstractmethod\n clean_up_executor(\n cardinalities: ../../tff/framework/CardinalitiesType\n )\n\nReleases any resources associated to the given cardinalities.\n\nNote that calling this method may invalidate the state of any executors\nwhich have previously been returned by the factory with the `cardinalities`\nargument ; `create_executor` should be called again if a new executor which\nis safe to use is desired.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----------------|-----------------------------------------------------------------|\n| `cardinalities` | The cardinalities of the executor whose state we wish to clear. |\n\n\u003cbr /\u003e\n\n### `create_executor`\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 @abc.abstractmethod\n create_executor(\n cardinalities: ../../tff/framework/CardinalitiesType\n ) -\u003e executor_base.Executor\n\nAbstract method to construct instance of `executor_base.Executor`.\n\n`create_executor` must accept a dict mapping\n`placements.PlacementLiterals` to `ints`, and return an\n`executor_base.Executor`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------|\n| `cardinalities` | a dict mapping instances of `placements.PlacementLiteral` to ints, specifying the population size at each placement. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Instance of `executor_base.Executor`. ||\n\n\u003cbr /\u003e"]]