Module: tff.framework

Libraries for extending the TensorFlow Federated core library.

Classes

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 DataDescriptor: Represents fully-specified data-yielding computations.

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 Literal: A representation of a literal 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 RemoteExecutor: The remote executor is a local proxy for a remote executor instance.

class RemoteExecutorGrpcStub: A stub connects to a remote executor service over gRPC.

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

class ResourceManagingExecutorFactory: Implementation of executor factory holding an executor per cardinality.

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.

Functions

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

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.

local_cpp_executor_factory(...): Returns an execution context backed by C++ runtime.

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

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.

to_call_dominant(...): Transforms local (non-federated) computations into call-dominant form.

transform_postorder(...): Traverses comp recursively postorder and replaces its constituents.

transform_preorder(...): Walks the AST of comp preorder, calling transform on the way down.

unique_name_generator(...): Yields a new unique name that does not exist in comp.

Type Aliases

CardinalitiesType

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