This function computes a sum such that it should not be possible for the
server to learn any clients individual value. The specific algorithm and
mechanism used to compute the secure sum may vary depending on the target
runtime environment the computation is compiled for or executed on. See
https://research.google/pubs/pub47246/ for more information.
Not all executors support tff.federated_secure_sum(); consult the
documentation for the specific executor or executor stack you plan on using
for the specific of how it's handled by that executor.
The max_input argument is the maximum value (inclusive) that may appear in
value. Lower values may allow for improved communication efficiency.
Attempting to return a value higher than max_input is invalid, and will
result in a failure at the given client.
An integer or nested structure of integers placed at tff.CLIENTS,
in the range [0, max_input].
max_input
A Python integer or nested structure of integers matching the
structure of value. If integer max_value is used with a nested
value, the same integer is used for each tensor in value.
Returns
A representation of the sum of the member constituents of value placed
on the tff.SERVER.
Raises
TypeError
If the argument is not a federated TFF value placed at
tff.CLIENTS.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.federated_secure_sum\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\nComputes a sum at [`tff.SERVER`](../tff#SERVER) of a `value` placed on the [`tff.CLIENTS`](../tff#CLIENTS). \n\n tff.federated_secure_sum(\n value, max_input\n )\n\nThis function computes a sum such that it should not be possible for the\nserver to learn any clients individual value. The specific algorithm and\nmechanism used to compute the secure sum may vary depending on the target\nruntime environment the computation is compiled for or executed on. See\n\u003chttps://research.google/pubs/pub47246/\u003e for more information.\n\nNot all executors support [`tff.federated_secure_sum()`](../tff/federated_secure_sum); consult the\ndocumentation for the specific executor or executor stack you plan on using\nfor the specific of how it's handled by that executor.\n\nThe `max_input` argument is the maximum value (inclusive) that may appear in\n`value`. *Lower values may allow for improved communication efficiency.*\nAttempting to return a `value` higher than `max_input` is invalid, and will\nresult in a failure at the given client.\n\n#### Example:\n\n value = tff.federated_value(1, tff.CLIENTS)\n result = tff.federated_secure_sum(value, 1)\n\n value = tff.federated_value((1, 2), tff.CLIENTS)\n result = tff.federated_secure_sum(value, (1, 2))\n\n| **Note:** To sum non-integer values or to sum integers with fewer constraints and weaker privacy properties, consider using `federated_sum`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `value` | An integer or nested structure of integers placed at [`tff.CLIENTS`](../tff#CLIENTS), in the range `[0, max_input]`. |\n| `max_input` | A Python integer or nested structure of integers matching the structure of `value`. If integer `max_value` is used with a nested `value`, the same integer is used for each tensor in `value`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A representation of the sum of the member constituents of `value` placed on the [`tff.SERVER`](../tff#SERVER). ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|-----------------------------------------------------------------------------------------|\n| `TypeError` | If the argument is not a federated TFF value placed at [`tff.CLIENTS`](../tff#CLIENTS). |\n\n\u003cbr /\u003e"]]