Similar to `to_graph`, but returns Python source code as a string. 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 cla
(entity,
recursive=True,
arg_values=None,
arg_types=None,
indentation=' ',
experimental_optional_features=None)
| 692 | |
| 693 | @tf_export(v1=['autograph.to_code']) |
| 694 | def to_code_v1(entity, |
| 695 | recursive=True, |
| 696 | arg_values=None, |
| 697 | arg_types=None, |
| 698 | indentation=' ', |
| 699 | experimental_optional_features=None): |
| 700 | """Similar to `to_graph`, but returns Python source code as a string. |
| 701 | |
| 702 | Also see: `tf.autograph.to_graph`. |
| 703 | |
| 704 | `to_graph` returns the Python source code that can be used to generate a |
| 705 | TensorFlow graph that is functionally identical to the input Python code. |
| 706 | |
| 707 | Args: |
| 708 | entity: Python callable or class to convert. |
| 709 | recursive: Whether to recursively convert any functions that the converted |
| 710 | function may call. |
| 711 | arg_values: Deprecated. |
| 712 | arg_types: Deprecated. |
| 713 | indentation: Deprecated. |
| 714 | experimental_optional_features: `None`, a tuple of, or a single |
| 715 | `tf.autograph.experimental.Feature` value. Controls the use of optional |
| 716 | features in the conversion process. |
| 717 | |
| 718 | Returns: |
| 719 | The converted code as string. |
| 720 | """ |
| 721 | del arg_values |
| 722 | del arg_types |
| 723 | del indentation |
| 724 | return to_code( |
| 725 | entity, |
| 726 | recursive=recursive, |
| 727 | experimental_optional_features=experimental_optional_features) |
| 728 | |
| 729 | |
| 730 | @tf_export('autograph.to_code', v1=[]) |