Missed TensorFlow World? Check out the recap. Learn more

tff.framework.remove_mapped_or_applied_identity

View source on GitHub

Removes all the mapped or applied identity functions in comp.

tff.framework.remove_mapped_or_applied_identity(comp)

This transform traverses comp postorder, matches the following pattern, and removes all the mapped or applied identity fucntions by replacing the following computation:

      Call
     /    \

Intrinsic Tuple | [Lambda(x), Comp(y)]
Ref(x)

Intrinsic(<(x -> x), y>)

with its argument:

Comp(y)

y

Args:

  • comp: The computation building block in which to perform the removals.

Returns:

A new computation with the transformation applied or the original comp.

Raises:

  • TypeError: If types do not match.