[null,null,["Last updated 2023-03-17 UTC."],[],[],null,["# tf.autograph.to_code\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.8.4/tensorflow/python/autograph/impl/api.py#L903-L945) |\n\nReturns the source code generated by AutoGraph, as a string. \n\n tf.autograph.to_code(\n entity, recursive=True, experimental_optional_features=None\n )\n\n#### Example usage:\n\n def f(x):\n if x \u003c 0:\n x = -x\n return x\n tf.autograph.to_code(f)\n \"...def tf__f(x):...\"\n\nAlso see: [`tf.autograph.to_graph`](../../tf/autograph/to_graph).\n**Note:** If a function has been decorated with [`tf.function`](../../tf/function), pass its underlying Python function, rather than the callable that \\`tf.function creates: \n\n @tf.function\n def f(x):\n if x \u003c 0:\n x = -x\n return x\n tf.autograph.to_code(f.python_function)\n \"...def tf__f(x):...\"\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------------------------|-----------------------------------------------------------------------------------------------------------------------|\n| `entity` | Python callable or class to convert. |\n| `recursive` | Whether to recursively convert any functions that the converted function may call. |\n| `experimental_optional_features` | `None`, a tuple of, or a single [`tf.autograph.experimental.Feature`](../../tf/autograph/experimental/Feature) value. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| The converted code as string. ||\n\n\u003cbr /\u003e"]]