[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.autograph.to_code\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/autograph/impl/api.py#L850-L901) |\n\nReturns the source code generated by AutoGraph, as a string. \n\n tf.compat.v1.autograph.to_code(\n entity,\n recursive=True,\n arg_values=None,\n arg_types=None,\n indentation=' ',\n 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. |\n| `recursive` | Whether to recursively convert any functions that the converted function may call. |\n| `arg_values` | Deprecated. |\n| `arg_types` | Deprecated. |\n| `indentation` | Deprecated. |\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"]]