tf.distribute.get_strategy
| Просмотреть исходный код на GitHub |
Возвращает текущий tf.distribute.Strategy объект.
tf.distribute.get_strategy()
Обычно используется только в контексте между репликами:
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/versions/r2.9/api_docs/python/tf/distribute/get_strategy