Automatically clean up tf.function reference cycles
Only works with autograph=False to start because of a function wrapping requirement which I've filed a bug for and will follow up on. Attaches objects which clean up reference cycles to PolymorphicFunctions and the Functions the PolymorphicFunctions use internally. Right now it leaves reference cycles in concrete functions which are returned outside of a PolymorphicFunction, since we have dataset tests which hold on to the FuncGraph but not the Function (and users might do this too). PiperOrigin-RevId: 225604754
Loading
Please sign in to comment