# tf.distribute.RunOptions

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/distribute/distribute_lib.py#L972-L1004) |

Run options for `strategy.run`.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.distribute.RunOptions`](https://www.tensorflow.org/api_docs/python/tf/distribute/RunOptions)

<br />

    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.

<br />

<br />

<br />

| ## 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`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/tpu/XLAOptions) instance. Only applies to TPUStrategy. Controls the XLA compiling options on TPUs. Default to None. |

<br />