Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tff.framework.remove_lambdas_and_blocks

View source

Removes any called lambdas and blocks from comp.

tff.framework.remove_lambdas_and_blocks(comp)

This function will rename all the variables in comp in a single walk of the AST, then replace called lambdas with blocks in another walk, since this transformation interacts with scope in delicate ways. It will chain inlining the blocks and collapsing the selection-from-tuple pattern together into a final pass.

Args:

  • comp: Instance of building_blocks.ComputationBuildingBlock from which we want to remove called lambdas and blocks.

Returns:

A transformed version of comp which has no called lambdas or blocks, and no extraneous selections from tuples.