Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.distribute.has_strategy

TensorFlow 2.0 version View source on GitHub

Return if there is a current non-default tf.distribute.Strategy.

Aliases:

  • tf.compat.v1.distribute.has_strategy
  • tf.compat.v2.distribute.has_strategy
  • tf.contrib.distribute.has_distribution_strategy
  • tf.contrib.distribute.has_strategy
tf.distribute.has_strategy()

Returns:

True if inside a with strategy.scope():.