# Module: tff

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

The TensorFlow Federated library.

## Modules

[`aggregators`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators) module: Libraries for constructing federated aggregation.

[`analytics`](https://www.tensorflow.org/federated/api_docs/python/tff/analytics) module: Libraries for using Federated Analytics algorithms.

[`backends`](https://www.tensorflow.org/federated/api_docs/python/tff/backends) module: Backends for constructing, compiling, and executing computations.

[`framework`](https://www.tensorflow.org/federated/api_docs/python/tff/framework) module: Libraries for extending the TensorFlow Federated core library.

[`jax`](https://www.tensorflow.org/federated/api_docs/python/tff/jax) module: Libraries for interacting with a JAX frontend and XLA backend.

[`learning`](https://www.tensorflow.org/federated/api_docs/python/tff/learning) module: Libraries for building federated learning algorithms.

[`program`](https://www.tensorflow.org/federated/api_docs/python/tff/program) module: Libraries for creating federated programs.

[`simulation`](https://www.tensorflow.org/federated/api_docs/python/tff/simulation) module: Libraries for running TensorFlow Federated simulations.

[`structure`](https://www.tensorflow.org/federated/api_docs/python/tff/structure) module: Container for structures with named and/or unnamed fields.

[`templates`](https://www.tensorflow.org/federated/api_docs/python/tff/templates) module: Templates for commonly used computations.

[`tensorflow`](https://www.tensorflow.org/federated/api_docs/python/tff/tensorflow) module: Libraries for interacting with a TensorFlow frontend and backend.

[`test`](https://www.tensorflow.org/federated/api_docs/python/tff/test) module: Libraries for testing TensorFlow Federated.

[`types`](https://www.tensorflow.org/federated/api_docs/python/tff/types) module: Libraries for interacting with the type of a computation.

## Classes

[`class Computation`](https://www.tensorflow.org/federated/api_docs/python/tff/Computation): An abstract interface for all classes that represent computations.

[`class FederatedType`](https://www.tensorflow.org/federated/api_docs/python/tff/types/FederatedType): An implementation of [`tff.Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type) representing federated types in TFF.

[`class FunctionType`](https://www.tensorflow.org/federated/api_docs/python/tff/types/FunctionType): An implementation of [`tff.Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type) representing functional types in TFF.

[`class SequenceType`](https://www.tensorflow.org/federated/api_docs/python/tff/types/SequenceType): An implementation of [`tff.Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type) representing types of sequences in TFF.

[`class StructType`](https://www.tensorflow.org/federated/api_docs/python/tff/types/StructType): An implementation of [`tff.Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type) representing structural types in TFF.

[`class StructWithPythonType`](https://www.tensorflow.org/federated/api_docs/python/tff/types/StructWithPythonType): A representation of a structure paired with a Python container type.

[`class TensorType`](https://www.tensorflow.org/federated/api_docs/python/tff/types/TensorType): An implementation of [`tff.Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type) representing types of tensors in TFF.

[`class Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type): An abstract interface for all classes that represent TFF types.

[`class TypedObject`](https://www.tensorflow.org/federated/api_docs/python/tff/TypedObject): An abstract interface for things that possess TFF type signatures.

[`class Value`](https://www.tensorflow.org/federated/api_docs/python/tff/Value): A generic base class for values that appear in TFF computations.

## Functions

[`federated_aggregate(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_aggregate): Aggregates `value` from [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS) to [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER).

[`federated_broadcast(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_broadcast): Broadcasts a federated value from the [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER) to the [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS).

[`federated_computation(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_computation): Decorates/wraps Python functions as TFF federated/composite computations.

[`federated_eval(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_eval): Evaluates a federated computation at `placement`, returning the result.

[`federated_map(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_map): Maps a federated value pointwise using a mapping function.

[`federated_max(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_max): Computes a max at [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER) of a `value` placed on the [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS).

[`federated_mean(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_mean): Computes a [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER) mean of `value` placed on [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS).

[`federated_min(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_min): Computes a min at [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER) of a `value` placed on the [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS).

[`federated_secure_select(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_secure_select): Sends privately-selected values from a server database to clients.

[`federated_secure_sum(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_secure_sum): Computes a sum at [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER) of a `value` placed on the [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS).

[`federated_secure_sum_bitwidth(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_secure_sum_bitwidth): Computes a sum at [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER) of a `value` placed on the [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS).

[`federated_select(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_select): Sends selected values from a server database to clients.

[`federated_sum(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_sum): Computes a sum at [`tff.SERVER`](https://www.tensorflow.org/federated/api_docs/python/tff#SERVER) of a `value` placed on the [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/tff#CLIENTS).

[`federated_value(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_value): Returns a federated value at `placement`, with `value` as the constituent.

[`federated_zip(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/federated_zip): Converts an N-tuple of federated values into a federated N-tuple value.

[`sequence_map(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/sequence_map): Maps a TFF sequence `value` pointwise using a given function `fn`.

[`sequence_reduce(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/sequence_reduce): Reduces a TFF sequence `value` given a `zero` and reduction operator `op`.

[`sequence_sum(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/sequence_sum): Computes a sum of elements in a sequence.

[`to_type(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/types/to_type): Converts the argument into an instance of [`tff.Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type).

[`to_value(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/to_value): Converts the argument into an instance of the abstract class [`tff.Value`](https://www.tensorflow.org/federated/api_docs/python/tff/Value).

<br />

<br />

<br />

| ## Other Members ||
|---|---|
| CLIENTS | Instance of [`tff.framework.PlacementLiteral`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/PlacementLiteral) |
| SERVER | Instance of [`tff.framework.PlacementLiteral`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/PlacementLiteral) |
| **version** | `'0.87.0'` |

<br />