![]() |
A strategy for resolving federated types and intrinsics.
Inherits From: FederatingStrategy
tff.framework.FederatedResolvingStrategy(
executor: tff.framework.FederatingExecutor
,
target_executors: dict[placements.PlacementLiteral, Union[list[executor_base.Executor],
executor_base.Executor]],
local_computation_factory: local_computation_factory_base.LocalComputationFactory = tensorflow_computation_factory.TensorFlowComputationFactory()
)
This strategy implements the federating_executor.FederatingStrategy
interface and provides logic for resolving federated types and federated
intrinsics on an underlying collection of target executor(s) associated with
individual placements.
This strategy only supports the placements:
Note that this strategy does not have a built-in concept of intermediate aggregation, partitioning placements, clustering clients, etc.
Args | |
---|---|
executor
|
A federating_executor.FederatingExecutor to use to handle
unplaced types, computations, and processing.
|
target_executors
|
A dict mapping placements to a collection of target
executors associated with individual placements. The keys in this
dictionary are placement literals. The values can be either single
executors (if there only is a single participant associated with that
placement, e.g. tff.SERVER ) or lists of executors.
|
local_computation_factory
|
An instance of LocalComputationFactory to use
to construct local computations used as parameters in certain federated
operators (such as tff.federated_sum , etc.). Defaults to a TensorFlow
computation factory that generates TensorFlow code.
|
Methods
close
close()
Release resources associated with this strategy, if any.
compute_federated_aggregate
compute_federated_aggregate(
arg
)
Returns an embedded call for a federated aggregate.
compute_federated_apply
compute_federated_apply(
arg
)
Returns an embedded call for a federated apply.
compute_federated_broadcast
compute_federated_broadcast(
arg
)
Returns an embedded call for a federated broadcast.
compute_federated_eval_at_clients
compute_federated_eval_at_clients(
arg
)
Returns an embedded call for a federated eval at clients.
compute_federated_eval_at_server
compute_federated_eval_at_server(
arg
)
Returns an embedded call for a federated eval at server.
compute_federated_intrinsic
compute_federated_intrinsic(
uri, arg=None
)
Returns an embedded call for a federated intrinsic.
Args | |
---|---|
uri
|
The URI of an intrinsic to embed. |
arg
|
An optional embedded argument of the call, or None if no argument
is supplied.
|
compute_federated_map
compute_federated_map(
arg
)
Returns an embedded call for a federated map.
compute_federated_map_all_equal
compute_federated_map_all_equal(
arg
)
Returns an embedded call for a federated map all equal.
compute_federated_mean
compute_federated_mean(
arg
)
Returns an embedded call for a federated mean.
compute_federated_secure_select
compute_federated_secure_select(
arg
)
Returns an embedded call for a federated secure select.
compute_federated_secure_sum_bitwidth
compute_federated_secure_sum_bitwidth(
arg
)
Returns an embedded call for a federated secure sum.
compute_federated_select
compute_federated_select(
arg
)
Returns an embedded call for a federated select.
compute_federated_sum
compute_federated_sum(
arg
)
Returns an embedded call for a federated sum.
compute_federated_value
compute_federated_value(
value, type_signature
)
Returns an embedded value for a federated type.
Args | |
---|---|
value
|
An object to embed in the executor. |
type_signature
|
A tff.Type , the type of value .
|
compute_federated_value_at_clients
compute_federated_value_at_clients(
arg
)
Returns an embedded call for a federated value at clients.
compute_federated_value_at_server
compute_federated_value_at_server(
arg
)
Returns an embedded call for a federated value at server.
compute_federated_weighted_mean
compute_federated_weighted_mean(
arg
)
Returns an embedded call for a federated weighted mean.
compute_federated_zip_at_clients
compute_federated_zip_at_clients(
arg
)
Returns an embedded call for a federated zip at clients.
compute_federated_zip_at_server
compute_federated_zip_at_server(
arg
)
Returns an embedded call for a federated zip at server.
factory
@classmethod
factory( target_executors: dict[placements.PlacementLiteral, Union[list[executor_base.Executor], executor_base.Executor]], local_computation_factory: local_computation_factory_base.LocalComputationFactory = tensorflow_computation_factory.TensorFlowComputationFactory() )
ingest_value
ingest_value(
value: Any,
type_signature: tff.types.Type
) -> tff.framework.ExecutorValue
reduce
reduce(
val, zero, op, op_type
)