Runs a federated computation on a given set of client data.

This method performs total_rounds calls to the computation. At each round, this method samples client data via client_selection_fn(round_num), and uses this as input to computation. The output of computation is assumed to be a mutable mapping with string-valued keys.

This method also records how long it takes (in seconds) to call client_selection_fn and computation at each round and adds this to a dictionary of round metrics with key tff.simulation.ROUND_TIME_KEY.

computation A tff.Computation to be executed. Must accept a single argument (placed or unplaced).
client_selection_fn Callable accepting an integer round number, and returning a list of client data to use as federated data for that round.
total_rounds The number of federated training rounds to perform.
metrics_managers An optional list of tff.program.ReleaseManagerss to use to save metrics.

An dictionary, keyed by round number, with values corresponding to the outputs of each round's computation, with extra keys for timing information.