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

Method assign_sub

tensorflow/python/distribute/values.py:1186–1197  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

1184 strategy, device_map, values, logical_device=logical_device)
1185
1186 def assign_sub(self, *args, **kwargs):
1187 with _enter_or_assert_strategy(self._distribute_strategy):
1188 if distribution_strategy_context.in_cross_replica_context():
1189 if self._aggregation == vs.VariableAggregation.SUM:
1190 raise ValueError(
1191 "SyncOnReadVariable does not support `assign_sub` in "
1192 "cross-replica context when aggregation is set to "
1193 "`tf.VariableAggregation.SUM`.")
1194 return control_flow_ops.group(tuple(
1195 _assign_sub_on_device(v.device, v, args[0]) for v in self._values))
1196 else:
1197 return self.get().assign_sub(*args, **kwargs)
1198
1199 def assign_add(self, *args, **kwargs):
1200 with _enter_or_assert_strategy(self._distribute_strategy):

Callers

nothing calls this directly

Calls 6

tupleFunction · 0.85
_assign_sub_on_deviceFunction · 0.85
groupMethod · 0.45
assign_subMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected