Stay organized with collections
Save and categorize content based on your preferences.
Conversion of eager-style Python into TensorFlow graph code.
AutoGraph transforms a subset of Python which operates on TensorFlow objects
into equivalent TensorFlow graph code. When executing the graph, it has the same
effect as if you ran the original code in eager mode.
Python code which doesn't operate on TensorFlow objects remains functionally
unchanged, but keep in mind that tf.function only executes such code at trace
time, and generally will not be consistent with eager execution.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# Module: tf.compat.v1.autograph\n\n\u003cbr /\u003e\n\nConversion of eager-style Python into TensorFlow graph code.\n| **Note:** In TensorFlow 2.0, AutoGraph is automatically applied when using [`tf.function`](../../../tf/function). This module contains lower-level APIs for advanced use.\n\nAutoGraph transforms a subset of Python which operates on TensorFlow objects\ninto equivalent TensorFlow graph code. When executing the graph, it has the same\neffect as if you ran the original code in eager mode.\nPython code which doesn't operate on TensorFlow objects remains functionally\nunchanged, but keep in mind that [`tf.function`](../../../tf/function) only executes such code at trace\ntime, and generally will not be consistent with eager execution.\n\nFor more information, see the\n[AutoGraph reference documentation](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/autograph/g3doc/reference/index.md),\nand the [tf.function guide](https://www.tensorflow.org/guide/function#autograph_transformations).\n\nModules\n-------\n\n[`experimental`](../../../tf/compat/v1/autograph/experimental) module: Public API for tf.autograph.experimental namespace.\n\nFunctions\n---------\n\n[`set_verbosity(...)`](../../../tf/autograph/set_verbosity): Sets the AutoGraph verbosity level.\n\n[`to_code(...)`](../../../tf/compat/v1/autograph/to_code): Returns the source code generated by AutoGraph, as a string.\n\n[`to_graph(...)`](../../../tf/compat/v1/autograph/to_graph): Converts a Python entity into a TensorFlow graph.\n\n[`trace(...)`](../../../tf/autograph/trace): Traces argument information at compilation time."]]