tff.backends.mapreduce.BroadcastForm
Stay organized with collections
Save and categorize content based on your preferences.
Standardized representation of server-to-client logic.
tff.backends.mapreduce.BroadcastForm(
compute_server_context,
client_processing,
server_data_label=None,
client_data_label=None
)
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))
Attributes |
client_data_label
|
|
client_processing
|
|
compute_server_context
|
|
server_data_label
|
|
Methods
summary
View source
summary(
print_fn=print
)
Prints a string summary of the BroadcastForm
.
Args |
print_fn
|
Print function to use. It will be called on each line of the
summary in order to capture the string summary.
|
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.backends.mapreduce.BroadcastForm\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\nStandardized representation of server-to-client logic. \n\n tff.backends.mapreduce.BroadcastForm(\n compute_server_context,\n client_processing,\n server_data_label=None,\n client_data_label=None\n )\n\nThis class is designed to represent computations of the form: \n\n server_data_type = self.compute_server_context.type_signature.parameter\n client_data_type = self.client_processing.type_signature.parameter[1]\n @tff.federated_computation(server_data_type, client_data_type)\n def _(server_data, client_data):\n # Select out the bit of server context to send to the clients.\n context_at_server = tff.federated_map(\n self.compute_server_context, server_data)\n\n # Broadcast the context to the clients.\n context_at_clients = tff.federated_broadcast(context_at_server)\n\n # Compute some value on the clients based on the server context and\n # the client data.\n return tff.federated_map(\n self.client_processing, (context_at_clients, client_data))\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|--------------------------|---------------|\n| `client_data_label` | \u003cbr /\u003e \u003cbr /\u003e |\n| `client_processing` | \u003cbr /\u003e \u003cbr /\u003e |\n| `compute_server_context` | \u003cbr /\u003e \u003cbr /\u003e |\n| `server_data_label` | \u003cbr /\u003e \u003cbr /\u003e |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `summary`\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 summary(\n print_fn=print\n )\n\nPrints a string summary of the `BroadcastForm`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------|--------------------------------------------------------------------------------------------------------------|\n| `print_fn` | Print function to use. It will be called on each line of the summary in order to capture the string summary. |\n\n\u003cbr /\u003e"]]