TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tff.framework.is_assignable_from

View source

Determines whether target_type is assignable from source_type.

tff.framework.is_assignable_from(
    target_type,
    source_type
)

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.