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

Method grad_sync

tensorflow/python/ops/control_flow_state.py:246–259  ·  view source on GitHub ↗

A control trigger node for synchronization in the grad loop. One main use is to keep the pop ops of a stack executed in the iteration order.

(self)

Source from the content-addressed store, hash-verified

244
245 @property
246 def grad_sync(self):
247 """A control trigger node for synchronization in the grad loop.
248
249 One main use is to keep the pop ops of a stack executed in the
250 iteration order.
251 """
252 if self._grad_sync is None:
253 with ops.control_dependencies(None):
254 self._grad_sync = control_flow_ops.control_trigger(name="b_sync")
255 self._grad_sync._set_control_flow_context(self._grad_context)
256 self._grad_index.op._add_control_input(self._grad_sync)
257 if self._grad_context.outer_context:
258 self._grad_context.outer_context.AddInnerOp(self._grad_sync)
259 return self._grad_sync
260
261 @property
262 def history_map(self):

Callers

nothing calls this directly

Calls 4

_add_control_inputMethod · 0.80
control_dependenciesMethod · 0.45
AddInnerOpMethod · 0.45

Tested by

no test coverage detected