Missed TensorFlow World? Check out the recap. Learn more

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():.