tff.framework.remove_mapped_or_applied_identity

View source on GitHub

Removes all the mapped or applied identity functions in 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

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

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

TypeError If types do not match.