MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _assert_strategy

Function _assert_strategy

tensorflow/python/distribute/values.py:571–580  ·  view source on GitHub ↗
(strategy)

Source from the content-addressed store, hash-verified

569
570
571def _assert_strategy(strategy):
572 if not distribution_strategy_context.has_strategy():
573 raise RuntimeError(
574 'Need to be inside "with strategy.scope()" for %s' %
575 (strategy,))
576 current_strategy = distribution_strategy_context.get_strategy()
577 if current_strategy is not strategy:
578 raise RuntimeError(
579 "Mixing different tf.distribute.Strategy objects: %s is not %s" %
580 (current_strategy, strategy))
581
582
583@contextlib.contextmanager

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected