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

Method _colocate_with_for_gradient

tensorflow/python/framework/ops.py:4235–4245  ·  view source on GitHub ↗
(self, op, gradient_uid,
                                  ignore_existing=False)

Source from the content-addressed store, hash-verified

4233
4234 @tf_contextlib.contextmanager
4235 def _colocate_with_for_gradient(self, op, gradient_uid,
4236 ignore_existing=False):
4237 with self.colocate_with(op, ignore_existing):
4238 if gradient_uid is not None and self._control_flow_context is not None:
4239 self._control_flow_context.EnterGradientColocation(op, gradient_uid)
4240 try:
4241 yield
4242 finally:
4243 self._control_flow_context.ExitGradientColocation(op, gradient_uid)
4244 else:
4245 yield
4246
4247 @tf_contextlib.contextmanager
4248 def colocate_with(self, op, ignore_existing=False):

Callers 4

_maybe_colocate_withFunction · 0.80
_GradientsHelperFunction · 0.80
_MultiDeviceAddNFunction · 0.80

Calls 3

colocate_withMethod · 0.95

Tested by

no test coverage detected