View source on GitHub |
Gets the strategy.scope() for training with strategy.
tfr.keras.strategy_utils.strategy_scope(
strategy: Optional[tf.distribute.Strategy]
) -> Any
Example usage:
with strategy_scope(strategy):
model = ...
Args | |
---|---|
strategy
|
Distributed training strategy is used. |
Returns | |
---|---|
ContextManager for the distributed training strategy. |