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

Method ExitGradientColocation

tensorflow/python/tpu/tpu.py:311–326  ·  view source on GitHub ↗
(self, op, gradient_uid)

Source from the content-addressed store, hash-verified

309 pass
310
311 def ExitGradientColocation(self, op, gradient_uid):
312 if op is not None:
313 if not self._gradient_colocation_stack:
314 raise errors.InternalError(
315 op.node_def, op,
316 "Badly nested gradient colocation: empty stack when popping Op " +
317 op.name)
318 last_op = self._gradient_colocation_stack.pop()
319 if op is last_op:
320 if op is self._in_gradient_colocation:
321 self._in_gradient_colocation = None
322 self._ExitOutsideCompilationScope()
323 else:
324 raise errors.InternalError(
325 op.node_def, op, "Badly nested gradient colocation, expected " +
326 last_op + ", got " + op.name)
327
328 def _EnterOutsideCompilationScope(self, cluster=None):
329

Callers 1

Calls 2

popMethod · 0.45

Tested by

no test coverage detected