Returns the current tf.distribute.Strategy
object.
View aliases
Main aliases
`tf.contrib.distribute.get_distribution_strategy`, `tf.contrib.distribute.get_strategy`
Compat aliases for migrationSee Migration guide for more details.
tf.compat.v1.distribute.get_strategy
, `tf.compat.v2.distribute.get_strategy`
tf.distribute.get_strategy()
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.
|