tff.backends.mapreduce.BroadcastForm

Standardized representation of server-to-client logic.

This class is designed to represent computations of the form:

server_data_type = self.compute_server_context.type_signature.parameter
client_data_type = self.client_processing.type_signature.parameter[1]
@tff.federated_computation(server_data_type, client_data_type)
def _(server_data, client_data):
  # Select out the bit of server context to send to the clients.
  context_at_server = tff.federated_map(
    self.compute_server_context, server_data)

  # Broadcast the context to the clients.
  context_at_clients = tff.federated_broadcast(context_at_server)

  # Compute some value on the clients based on the server context and
  # the client data.
  return tff.federated_map(
    self.client_processing, (context_at_clients, client_data))

client_data_label

client_processing

compute_server_context

server_data_label

Methods

summary

View source

Prints a string summary of the BroadcastForm.

Arguments
print_fn Print function to use. It will be called on each line of the summary in order to capture the string summary.