Save the date! Google I/O returns May 18-20 Register now

Module: tff.types

Libraries for interacting with the type of a computation.

Classes

class AbstractType: An implementation of tff.Type representing abstract types in TFF.

class FederatedType: An implementation of tff.Type representing federated types in TFF.

class FunctionType: An implementation of tff.Type representing functional types in TFF.

class PlacementType: An implementation of tff.Type representing the placement type in TFF.

class SequenceType: An implementation of tff.Type representing types of sequences in TFF.

class StructType: An implementation of tff.Type representing structural types in TFF.

class StructWithPythonType: A representation of a structure paired with a Python container type.

class TensorType: An implementation of tff.Type representing types of tensors in TFF.

class Type: An abstract interface for all classes that represent TFF types.

class TypeNotAssignableError: Inappropriate argument type.

class TypeRelation: An enumeration.

class TypesNotEquivalentError: Inappropriate argument type.

class TypesNotIdenticalError: Inappropriate argument type.

class UnexpectedTypeError: Inappropriate argument type.

Functions

at_clients(...): Constructs a federated type of the form {T}@CLIENTS.

at_server(...): Constructs a federated type of the form T@SERVER.

clear_disallowed_cache(...)

clear_intern_pool(...)

contains(...): Checks if type_signature contains any types that pass predicate.

count(...): Returns the number of types in type_signature matching predicate.

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

is_structure_of_floats(...): Determines if type_spec is a structure of floats.

is_structure_of_integers(...): Determines if type_spec is a structure of integers.

is_structure_of_tensors(...)

is_tensorflow_compatible_type(...): Checks type_spec against an explicit list of tf_computation.

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

to_type(...): Converts the argument into an instance of tff.Type.

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

type_mismatch_error_message(...): Returns an error message describing the mismatch between two types.

type_to_py_container(...): Recursively convert structure.Structs to Python containers.

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

C Instance of typing.TypeVar
MAX_LINE_LEN 100