Get tf.distribute.RunOptions from config.
(config: ExperimentConfig)
| 124 | |
| 125 | |
| 126 | def get_runtime_options(config: ExperimentConfig): |
| 127 | """Get tf.distribute.RunOptions from config.""" |
| 128 | xla_options = {} |
| 129 | if config.runtime.tpu_enable_xla_dynamic_padder is not None: |
| 130 | xla_options["enable_xla_dynamic_padder"] = ( |
| 131 | config.runtime.tpu_enable_xla_dynamic_padder) |
| 132 | return tf.distribute.RunOptions( |
| 133 | experimental_xla_options=tf.tpu.XLAOptions(**xla_options)) |
| 134 | |
| 135 | |
| 136 | @gin.configurable |