# tff.federated_map

<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) |

Maps a federated value pointwise using a mapping function.

    tff.federated_map(
        fn, arg
    )

The function `fn` is applied separately across the group of devices
represented by the placement type of `arg`. For example, if `value` has
placement type [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS), then `fn` is applied to each client
individually. In particular, this operation does not alter the placement of
the federated value.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `fn` | A mapping function to apply pointwise to member constituents of `arg`. The parameter of this function must be of the same type as the member constituents of `arg`. |
| `arg` | A value of a TFF federated type (or a value that can be implicitly converted into a TFF federated type, e.g., by zipping) placed at [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS) or [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A federated value with the same placement as `arg` that represents the result of `fn` on the member constituent of `arg`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If the arguments are not of the appropriate types. |

<br />