tf.contrib.autograph.ConversionOptions

Class ConversionOptions

Defined in tensorflow/python/autograph/core/converter.py.

Immutable container for global conversion flags.

Attributes:

  • recursive: bool, whether to recursively convert any user functions or classes that the converted function may use.
  • verbose: Verbosity, the level of verbosity to use.
  • strip_decorators: Tuple[Callable], contains decorators that should be in excluded from the compiled output. By default, when converting a function before the decorators are applied, the compiled output will include those decorators.
  • force_conversion: bool, whether to force convertinng the target entity. When force_conversion is turned off, the converter may decide to return the function as-is.
  • optional_features: Union[Feature, Set[Feature]], controls the use of optional features in the conversion process. See Feature for available options.

__init__

__init__(
    recursive=False,
    verbose=Verbosity.VERBOSE,
    strip_decorators=None,
    force_conversion=False,
    internal_convert_user_code=True,
    optional_features=tf.autograph.experimental.Feature.ALL
)

Initialize self. See help(type(self)) for accurate signature.

Properties

strip_decorators

Methods

tf.contrib.autograph.ConversionOptions.should_strip

should_strip(decorator)

tf.contrib.autograph.ConversionOptions.to_ast

to_ast(
    ctx,
    internal_convert_user_code=None
)

Returns a representation of this object as an AST node.

The AST node encodes a constructor that would create an object with the same contents.

Args:

  • ctx: EntityContext, the entity with which this AST needs to be consistent.
  • internal_convert_user_code: Optional[bool], allows ovrriding the corresponding value.

Returns:

ast.Node

tf.contrib.autograph.ConversionOptions.uses

uses(feature)