tf.autograph.to_code
Stay organized with collections
Save and categorize content based on your preferences.
Similar to to_graph
, but returns Python source code as a string.
tf.autograph.to_code(
entity, recursive=True, arg_values=None, arg_types=None, indentation=' ',
experimental_optional_features=None
)
Also see: tf.autograph.to_graph
.
to_graph
returns the Python source code that can be used to generate a
TensorFlow graph that is functionally identical to the input Python code.
Args |
entity
|
Python callable or class to convert.
|
recursive
|
Whether to recursively convert any functions that the converted
function may call.
|
arg_values
|
Deprecated.
|
arg_types
|
Deprecated.
|
indentation
|
Deprecated.
|
experimental_optional_features
|
None , a tuple of, or a single
tf.autograph.experimental.Feature value. Controls the use of optional
features in the conversion process.
|
Returns |
The converted code as string.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.autograph.to_code\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/autograph/to_code) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/autograph/impl/api.py#L693-L727) |\n\nSimilar to `to_graph`, but returns Python source code as a string.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.autograph.to_code`](/api_docs/python/tf/compat/v1/autograph/to_code)\n\n\u003cbr /\u003e\n\n tf.autograph.to_code(\n entity, recursive=True, arg_values=None, arg_types=None, indentation=' ',\n experimental_optional_features=None\n )\n\nAlso see: [`tf.autograph.to_graph`](../../tf/autograph/to_graph).\n\n`to_graph` returns the Python source code that can be used to generate a\nTensorFlow graph that is functionally identical to the input Python code.\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| `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. Controls the use of optional features in the conversion process. |\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"]]