tf.distribute.experimental.auto_strategy

Automatically detects hardware and returns the optimal strategy.

auto_strategy is a factory that detects the available hardware configuration (TPUs, multiple GPUs, multi-worker clusters) and instantiates the most appropriate tf.distribute.Strategy. This eliminates the need for manual device profiling and strategy selection.

An instance of a tf.distribute.Strategy.

Example:

strategy = tf.distribute.experimental.auto_strategy()
with strategy.scope():
  model = ...