tff.framework.is_assignable_from

Determines whether target_type is assignable from source_type.

tff.framework.is_assignable_from(
    target_type,
    source_type
)

Defined in core/impl/type_utils.py.

Args:

  • target_type: The expected type (that of the target of the assignment).
  • source_type: The actual type (that of the source of the assignment), tested for being a specialization of the target_type.

Returns:

True iff target_type is assignable from source_type, or else False.

Raises:

  • TypeError: If the arguments are not TFF types.