TensorFlow 2.0 Beta is available Learn more

Module: tff.framework

Interfaces for extensions, selectively lifted out of impl.

Defined in python/core/framework/__init__.py.

Classes

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 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 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 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 Tuple: A tuple with named or unnamed elements in TFF's internal language.

Functions

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

check_has_unique_names(...)

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

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.

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(...): Returns True if comp is a called intrinsic with the uri or uris.

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

merge_tuple_intrinsics(...): Merges all the tuples of intrinsics in comp into one intrinsic.

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.

replace_selection_from_tuple_with_element(...): Replaces any selection from a tuple with the underlying tuple element.

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.

Other Members

  • FEDERATED_AGGREGATE
  • FEDERATED_APPLY
  • FEDERATED_BROADCAST
  • FEDERATED_MAP
  • FEDERATED_MAP_ALL_EQUAL