AutoGraph

Automatically converting Python code into its graphical representation is done with the use of AutoGraph. In TensorFlow 2.0, AutoGraph is automatically applied to a function when it is decorated with @tf.function. This decorator creates callable graphs from Python functions.

A function, once decorated correctly, is processed by tf.function and the tf.autograph module in order to convert it into its graphical representation. The following diagram shows a schematic representation of what happens when a decorated function is called:

Schematic representation of what happens when a function, f, decorated with @tf.function, which is called ...

Get Hands-On Neural Networks with TensorFlow 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.