View source on GitHub
|
Automatically detects hardware and returns the optimal strategy.
tf.distribute.experimental.auto_strategy() -> distribute_lib.StrategyBase
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.
Returns | |
|---|---|
An instance of a tf.distribute.Strategy.
|
Example:
strategy = tf.distribute.experimental.auto_strategy()
with strategy.scope():
model = ...
View source on GitHub