# tff.federated_secure_select

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) 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) |

Sends privately-selected values from a server database to clients.

    tff.federated_secure_select(
        client_keys, max_key, server_val, select_fn
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `client_keys` | [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/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`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER)-placed `int32` which is guaranteed to be greater than any of `client_keys`. Lower values may permit more optimizations. |
| `server_val` | [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER)-placed value used as an input to `select_fn`. |
| `select_fn` | A [`tff.Computation`](https://www.tensorflow.org/federated/api_docs/python/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). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/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), ...]`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `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`. |

<br />