Spec-Zone.ru › TensorFlow

tf.distribute.get_strategy

Returns the current tf.distribute.Strategy object.

View aliases

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.distribute.get_strategy

tf.distribute.get_strategy() -> 'StrategyBase'

Used in the notebooks

Used in the guide
  • Distributed training with TensorFlow

Typically only used in a cross-replica context:

if tf.distribute.in_cross_replica_context():
  strategy = tf.distribute.get_strategy()
  ...
Returns
A tf.distribute.Strategy object. Inside a with strategy.scope() block, it returns strategy, otherwise it returns the default (single-replica) tf.distribute.Strategy object.

© 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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API