tf.distribute.get_strategy
Возвращает текущий объект tf.distribute.Strategy.
tf.distribute.get_strategy() -> 'StrategyBase'
Использование в ноутбуках
| Используется в руководстве |
|---|
Обычно используется только в контексте крос-репликации:
if tf.distribute.in_cross_replica_context(): strategy = tf.distribute.get_strategy() ...
| Возвращает | |
|---|---|
Объект tf.distribute.Strategy. Внутри блока with strategy.scope(), он возвращает strategy, в противном случае возвращает стандартный (однорепличный) объект tf.distribute.Strategy. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/distribute/get_strategy