Module: tff.framework

Libraries for extending the TensorFlow Federated core library.


class AsyncContext: An asynchronous context to evaluate of computations.

class AsyncExecutionContext: An asynchronous execution context backed by an executor_base.Executor.

class Block: A representation of a block of code in TFF's internal language.

class Call: A representation of a function invocation in TFF's internal language.

class CardinalityCarrying: Asbtract interface for objects that carry information about cardinality.

class CardinalityFreeDataDescriptor: Represent data-yielding computations with unspecified cardinalities.

class CompiledComputation: A representation of a fully constructed and serialized computation.

class ComputationBuildingBlock: The abstract base class for abstractions in the TFF's internal language.

class ConcreteComputation: A representation of a pb.Computation in the tff.Computation interface.

class ContextStack: An interface to a context stack for the API to run against.

class Data: A representation of data (an input pipeline).

class DataBackend: Abstract interface for data backends.

class DataDescriptor: Represents fully-specified data-yielding computations.

class DataExecutor: The data executor is responsible for the data building block.

class EagerTFExecutor: The eager executor only runs TensorFlow, synchronously, in eager mode.

class ExecutorFactory: Interface defining executor factories.

class Ingestable: Abstract interface for objects able to ingest themselves in an executor.

class Intrinsic: A representation of an intrinsic in TFF's internal language.

class Lambda: A representation of a lambda expression in TFF's internal language.

class MergeableCompExecutionContext: Context which executes mergeable computations in subrounds.

class MergeableCompForm: A data class for computations containing a single logical aggregation.

class Placement: A representation of a placement literal in TFF's internal language.

class PlacementLiteral

class Reference: A reference to a name defined earlier in TFF's internal language.

class RemoteExecutorStub: Represents the interface of stubs call to an remote executor instance.

class RetryableError: Raised when execution fails and can be retried.

class Selection: A selection by name or index from a struct-typed value in TFF's language.

class Struct: A struct with named or unnamed elements in TFF's internal language.

class SyncContext: A synchronous context to evaluate of computations.

class SyncExecutionContext: A synchronous execution context backed by an executor_base.Executor.

class UnexpectedBlockError: Inappropriate argument type.


CreateDataDescriptor(...): Constructs a DataDescriptor instance targeting a tff.DataBackend.

check_allowed_ops(...): Checks any Tensorflow computation contains only allowed ops.

check_disallowed_ops(...): Raises error on disallowed ops in any Tensorflow computation.

deserialize_computation(...): Deserializes 'tff.Computation' as a pb.Computation.

deserialize_value(...): Deserializes a value (of any type) from executor_pb2.Value.

get_context_stack(...): Returns the context stack.

get_session_token(...): Returns a string tensor identifying the current session.

local_executor_factory(...): Constructs an executor factory to execute computations locally.

merge_cardinalities(...): Merges dicts existing and to_add, checking for conflicts.

replace_intrinsics_with_bodies(...): Iterates over all intrinsic bodies, inlining the intrinsics in comp.

serialize_computation(...): Serializes 'tff.Computation' as a pb.Computation.

serialize_value(...): Serializes a value into executor_pb2.Value.

set_default_context(...): Places ctx at the bottom of the stack.

Type Aliases