tff.federated_select

Sends selected values from a server database to clients.

Used in the notebooks

Used in the tutorials

client_keys tff.CLIENTS-placed one-dimensional fixed-size non-negative int32 keys used to select values from database to load for each client.
max_key A tff.SERVER-placed int32 indicating the maximum value of any of client_keys (so that all client keys are in the range [0, max_key], inclusive). Lower values may permit more optimizations.
server_val tff.SERVER-placed value used as an input to select_fn.
select_fn A tff.Computation which accepts unplaced server_val and a int32 client key and returns a value to be sent to the client. select_fn should be deterministic (nonrandom).

tff.CLIENTS-placed sequences of values returned from select_fn. In each sequence, the order of values will match the order of keys in the corresponding client_keys tensor. For example, a client with keys [1, 2, ...] will receive a sequence of values [select_fn(server_val, 1), select_fn(server_val, 2), ...].

TypeError If client_keys is not of type {int32[N]}@CLIENTS, if max_key is not of type int32@SERVER, if server_val is not a server-placed value (S@SERVER), or if select_fn is not a function of type <S, int32> -> RESULT.