tf.distribute.RunOptions  |  TensorFlow v2.16.1 (original) (raw)

tf.distribute.RunOptions

Stay organized with collections Save and categorize content based on your preferences.

Run options for strategy.run.

View aliases

Compat aliases for migration

SeeMigration guide for more details.

tf.compat.v1.distribute.RunOptions

tf.distribute.RunOptions(
    experimental_enable_dynamic_batch_size=True,
    experimental_bucketizing_dynamic_shape=False,
    experimental_xla_options=None
)

This can be used to hold some strategy specific configs.

Attributes
experimental_enable_dynamic_batch_size Boolean. Only applies to TPUStrategy. Default to True. If True, TPUStrategy will enable dynamic padder to support dynamic batch size for the inputs. Otherwise only static shape inputs are allowed.
experimental_bucketizing_dynamic_shape Boolean. Only applies to TPUStrategy. Default to False. If True, TPUStrategy will automatic bucketize inputs passed into run if the input shape is dynamic. This is a performance optimization to reduce XLA recompilation, which should not have impact on correctness.
experimental_xla_options A tf.tpu.XLAOptions instance. Only applies to TPUStrategy. Controls the XLA compiling options on TPUs. Default to None.

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. Some content is licensed under the numpy license.

Last updated 2024-04-26 UTC.