Module: tff.framework

View source on GitHub

Interfaces for extensions, selectively lifted out of impl.


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

class CachingExecutor: The caching executor only performs caching.

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

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

class ComposingExecutor: An executor composed of subordinate executors that manage disjoint scopes.

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

class Context: Represents the interface to the context that the API executes against.

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

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

class Executor: Represents the abstract interface that all executors must implement.

class ExecutorFactory: Interface defining executor factories.

class ExecutorService: A wrapper around a target executor that makes it into a gRPC service.

class ExecutorValue: Represents the abstract interface for values embedded within executors.

class FederatingExecutor: The federated executor orchestrates federated computations.

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 Placement: A representation of a placement literal in TFF's internal language.

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

class ReferenceResolvingExecutor: The lambda executor handles lambda expressions and related abstractions.

class RemoteExecutor: The remote executor is a local proxy for a remote executor instance.

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

class TFParser: Callable taking subset of TFF AST constructs to CompiledComputations.

class ThreadDelegatingExecutor: The concurrent executor delegates work to a separate thread.

class TransformingExecutor: This executor transforms computations prior to executing them.

class Tuple: A tuple with named or unnamed elements in TFF's internal language.


are_equivalent_types(...): Determines whether type1 and type2 are equivalent.

building_block_to_computation(...): Converts a computation building block to a computation impl.

check_broadcast_not_dependent_on_aggregate(...): Raises if any broadcast in tree ingests the result of an aggregate.


check_intrinsics_whitelisted_for_reduction(...): Checks whitelist of intrinsics reducible to aggregate or broadcast.

create_executor_factory(...): Create an ExecutorFactory for a given executor stack function.

create_federated_map_all_equal(...): Creates a called federated map of equal values.

create_federated_map_or_apply(...): Creates a called federated map or apply depending on args placement.

create_federated_zip(...): Creates a called federated zip.

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

deserialize_type(...): Deserializes 'type_proto' as a computation_types.Type.

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

get_map_of_unbound_references(...): Gets a Python dict of the unbound references in comp.

inline_block_locals(...): Inlines the block variables in comp whitelisted by variable_names.

insert_called_tf_identity_at_leaves(...): Inserts an identity TF graph called on References under comp.

is_assignable_from(...): Determines whether target_type is assignable from source_type.

is_called_intrinsic(...): Tests if comp is a called intrinsic with the given uri.

is_tensorflow_compatible_type(...): Checks type_spec against an explicit whitelist for tf_computation.

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

merge_tuple_intrinsics(...): Merges tuples of called intrinsics into one called intrinsic.

remove_lambdas_and_blocks(...): Removes any called lambdas and blocks from comp.

remove_mapped_or_applied_identity(...): Removes all the mapped or applied identity functions in comp.

replace_called_lambda_with_block(...): Replaces all the called lambdas in comp with a block.

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

serialize_type(...): Serializes 'type_spec' as a pb.Type.

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

set_default_executor(...): Places an executor-backed execution context at the top of the stack.

sizing_executor_factory(...): Constructs an executor to execute computations on the local machine with sizing.

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

transform_type_postorder(...): Walks type tree of type_signature postorder, calling transform_fn.

type_from_tensors(...): Builds a tff.Type from supplied tensors.

type_to_tf_tensor_specs(...): Returns nested structure of tf.TensorSpecs for a given TFF type.

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

uniquify_reference_names(...): Replaces all the bound reference names in comp with unique names.

unwrap_placement(...): Strips comp's placement, returning a single call to map, apply or value.

worker_pool_executor_factory(...): Create an executor backed by a worker pool.

Other Members