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

Function _assert_replica_context

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

Source from the content-addressed store, hash-verified

1165
1166
1167def _assert_replica_context(strategy):
1168 replica_context = distribution_strategy_context.get_replica_context()
1169 if not replica_context:
1170 raise RuntimeError(
1171 "Replica-local variables may only be assigned in a replica context.")
1172 if replica_context.strategy is not strategy:
1173 raise RuntimeError(
1174 "Replica-local variables may only be assigned in a replica context.")
1175
1176
1177class SyncOnReadVariable(DistributedVariable):

Callers 1

_assign_funcMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected