# Module: tff.framework

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

Libraries for extending the TensorFlow Federated core library.

## Classes

[`class AsyncContext`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/AsyncContext): An asynchronous context to evaluate of computations.

[`class AsyncExecutionContext`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/AsyncExecutionContext): An asynchronous execution context backed by an `executor_base.Executor`.

[`class Block`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Block): A representation of a block of code in TFF's internal language.

[`class Call`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Call): A representation of a function invocation in TFF's internal language.

[`class CardinalityCarrying`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/CardinalityCarrying): Asbtract interface for objects that carry information about cardinality.

[`class CardinalityFreeDataDescriptor`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/CardinalityFreeDataDescriptor): Represent data-yielding computations with unspecified cardinalities.

[`class CompiledComputation`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/CompiledComputation): A representation of a fully constructed and serialized computation.

[`class ComputationBuildingBlock`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/ComputationBuildingBlock): The abstract base class for abstractions in the TFF's internal language.

[`class ConcreteComputation`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/ConcreteComputation): A representation of a `pb.Computation` in the [`tff.Computation`](https://www.tensorflow.org/federated/api_docs/python/tff/Computation) interface.

[`class ContextStack`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/ContextStack): An interface to a context stack for the API to run against.

[`class Data`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Data): A representation of data (an input pipeline).

[`class DataDescriptor`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/DataDescriptor): Represents fully-specified data-yielding computations.

[`class ExecutorFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/ExecutorFactory): Interface defining executor factories.

[`class Ingestable`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Ingestable): Abstract interface for objects able to ingest themselves in an executor.

[`class Intrinsic`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Intrinsic): A representation of an intrinsic in TFF's internal language.

[`class Lambda`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Lambda): A representation of a lambda expression in TFF's internal language.

[`class Literal`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Literal): A representation of a literal in TFF's internal language.

[`class MergeableCompExecutionContext`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/MergeableCompExecutionContext): Context which executes mergeable computations in subrounds.

[`class MergeableCompForm`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/MergeableCompForm): A data class for computations containing a single logical aggregation.

[`class Placement`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Placement): A representation of a placement literal in TFF's internal language.

[`class PlacementLiteral`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/PlacementLiteral)

[`class Reference`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Reference): A reference to a name defined earlier in TFF's internal language.

[`class RemoteExecutor`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/RemoteExecutor): The remote executor is a local proxy for a remote executor instance.

[`class RemoteExecutorGrpcStub`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/RemoteExecutorGrpcStub): A stub connects to a remote executor service over gRPC.

[`class RemoteExecutorStub`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/RemoteExecutorStub): Represents the interface of stubs call to an remote executor instance.

[`class ResourceManagingExecutorFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/ResourceManagingExecutorFactory): Implementation of executor factory holding an executor per cardinality.

[`class RetryableError`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/RetryableError): Raised when execution fails and can be retried.

[`class Selection`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Selection): A selection by name or index from a struct-typed value in TFF's language.

[`class Struct`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/Struct): A struct with named or unnamed elements in TFF's internal language.

[`class SyncContext`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/SyncContext): A synchronous context to evaluate of computations.

[`class SyncExecutionContext`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/SyncExecutionContext): A synchronous execution context backed by an `executor_base.Executor`.

[`class UnexpectedBlockError`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/UnexpectedBlockError): Inappropriate argument type.

## Functions

[`CreateDataDescriptor(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/CreateDataDescriptor): Constructs a `DataDescriptor` instance targeting a `tff.DataBackend`.

[`deserialize_computation(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/deserialize_computation): Deserializes 'tff.Computation' as a pb.Computation.

[`deserialize_value(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/deserialize_value): Deserializes a value (of any type) from `executor_pb2.Value`.

[`get_context_stack(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/get_context_stack): Returns the context stack.

[`local_cpp_executor_factory(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/local_cpp_executor_factory): Returns an execution context backed by C++ runtime.

[`merge_cardinalities(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/merge_cardinalities): Merges dicts `existing` and `to_add`, checking for conflicts.

[`serialize_computation(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/serialize_computation): Serializes 'tff.Computation' as a pb.Computation.

[`serialize_value(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/serialize_value): Serializes a value into `executor_pb2.Value`.

[`set_default_context(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/set_default_context): Places `ctx` at the bottom of the stack.

[`to_call_dominant(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/to_call_dominant): Transforms local (non-federated) computations into call-dominant form.

[`transform_postorder(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/transform_postorder): Traverses `comp` recursively postorder and replaces its constituents.

[`transform_preorder(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/transform_preorder): Walks the AST of `comp` preorder, calling `transform` on the way down.

[`unique_name_generator(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/unique_name_generator): Yields a new unique name that does not exist in `comp`.

## Type Aliases

[`CardinalitiesType`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/CardinalitiesType)

<br />

<br />

<br />

| ## Other Members ||
|---|---|
| FEDERATED_AGGREGATE | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_APPLY | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_BROADCAST | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_EVAL_AT_CLIENTS | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_EVAL_AT_SERVER | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_MAP | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_MAP_ALL_EQUAL | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_SUM | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_VALUE_AT_CLIENTS | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_VALUE_AT_SERVER | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_ZIP_AT_CLIENTS | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |
| FEDERATED_ZIP_AT_SERVER | Instance of `tensorflow_federated.python.core.impl.compiler.intrinsic_defs.IntrinsicDef` |

<br />