Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tff.FunctionType

View source

Class FunctionType

An implementation of tff.Type representing functional types in TFF.

Inherits From: Type

__init__

View source

__init__(
    parameter,
    result
)

Constructs a new instance from the given parameter and result types.

Args:

  • parameter: A specification of the parameter type, either an instance of tff.Type or something convertible to it by tff.to_type. Multiple input arguments can be specified as a single tff.NamedTupleType.
  • result: A specification of the result type, either an instance of tff.Type or something convertible to it by tff.to_type.

Properties

parameter

result

Methods

__eq__

View source

__eq__(other)

Determines whether two type definitions are identical.

Note that this notion of equality is stronger than equivalence. Two types with equivalent definitions may not be identical, e.g., if they represent templates with differently named type variables in their definitions.

Args:

  • other: The other type to compare against.

Returns:

True iff type definitions are syntatically identical (as defined above), or False otherwise.

Raises:

  • NotImplementedError: If not implemented in the derived class.

__ne__

View source

__ne__(other)

Return self!=value.

compact_representation

View source

compact_representation()

Returns the compact string representation of this type.

formatted_representation

View source

formatted_representation()

Returns the formatted string representation of this type.