Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tff.framework.local_executor_factory

View source on GitHub

Constructs an executor factory to execute computations locally.

tff.framework.local_executor_factory(
    num_clients=None, max_fanout=100, clients_per_thread=1, tf_devices=tuple()
)

Args:

  • num_clients: The number of clients. If specified, the executor factory function returned by local_executor_factory will be configured to have exactly num_clients clients. If unspecified (None), then the function returned will attempt to infer cardinalities of all placements for which it is passed values.
  • max_fanout: The maximum fanout at any point in the aggregation hierarchy. If num_clients > max_fanout, the constructed executor stack will consist of multiple levels of aggregators. The height of the stack will be on the order of log(num_clients) / log(max_fanout).
  • clients_per_thread: The number of clients which will share a single thread. Adjusting this parameter away from 1 can be useful if clients work is light.
  • tf_devices: The list of devices to run clients for simulation. The tf.config.LogicalDevice list can often be returned by tf.config.list_logical_devices().

Returns:

An instance of executor_factory.ExecutorFactory encapsulating the executor construction logic specified above.

Raises:

  • ValueError: If the number of clients is specified and not one or larger.