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

Inherits From: Type

Used in the notebooks

Used in the tutorials

member An instance of tff.Type or something convertible to it, that represents the type of the member components of each value of this federated type.
placement The specification of placement that the member components of this federated type are hosted on. Must be either a placement literal such as tff.SERVER or tff.CLIENTS to refer to a globally defined placement, or a placement label to refer to a placement defined in other parts of a type signature. Specifying placement labels is not implemented yet.
all_equal A bool value that indicates whether all members of the federated type are equal (True), or are allowed to differ (False). If all_equal is None, the value is selected as the default for the placement, e.g., True for tff.SERVER and False for tff.CLIENTS.






View source

Raises if values of source_type cannot be cast to this type.


View source

Raises if values of 'other' cannot be cast to and from this type.


View source

Raises if other and Type are not exactly identical.


View source

Returns a generator yielding immediate child types.


View source

Returns the compact string representation of this type.


View source

Returns the formatted string representation of this type.


View source

Returns whether values of source_type can be cast to this type.


View source

Returns whether values of other can be cast to and from this type.


View source

Returns whether or not self and other are exactly identical.


View source

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.

other The other type to compare against.

True if type definitions are syntactically identical (as defined above), otherwise False.

NotImplementedError If not implemented in the derived class.


View source

Return self!=value.