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

Method assign_add

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

Source from the content-addressed store, hash-verified

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):
1201 if distribution_strategy_context.in_cross_replica_context():
1202 if self._aggregation == vs.VariableAggregation.SUM:
1203 raise ValueError(
1204 "SyncOnReadVariable does not support `assign_add` in "
1205 "cross-replica context when aggregation is set to "
1206 "`tf.VariableAggregation.SUM`.")
1207 return control_flow_ops.group(tuple(
1208 _assign_add_on_device(v.device, v, args[0]) for v in self._values))
1209 else:
1210 return self.get().assign_add(*args, **kwargs)
1211
1212 def assign(self, *args, **kwargs):
1213 with _enter_or_assert_strategy(self._distribute_strategy):

Callers

nothing calls this directly

Calls 6

tupleFunction · 0.85
_assign_add_on_deviceFunction · 0.85
groupMethod · 0.45
assign_addMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected