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

Function control_dependencies

tensorflow/python/framework/ops.py:5306–5334  ·  view source on GitHub ↗

Wrapper for `Graph.control_dependencies()` using the default graph. See `tf.Graph.control_dependencies` for more details. When eager execution is enabled, any callable object in the `control_inputs` list will be called. Args: control_inputs: A list of `Operation` or `Tensor` objects

(control_inputs)

Source from the content-addressed store, hash-verified

5304
5305@tf_export("control_dependencies")
5306def control_dependencies(control_inputs):
5307 """Wrapper for `Graph.control_dependencies()` using the default graph.
5308
5309 See `tf.Graph.control_dependencies`
5310 for more details.
5311
5312 When eager execution is enabled, any callable object in the `control_inputs`
5313 list will be called.
5314
5315 Args:
5316 control_inputs: A list of `Operation` or `Tensor` objects which must be
5317 executed or computed before running the operations defined in the context.
5318 Can also be `None` to clear the control dependencies. If eager execution
5319 is enabled, any callable object in the `control_inputs` list will be
5320 called.
5321
5322 Returns:
5323 A context manager that specifies control dependencies for all
5324 operations constructed within the context.
5325 """
5326 if context.executing_eagerly():
5327 if control_inputs:
5328 # Excute any pending callables.
5329 for control in control_inputs:
5330 if callable(control):
5331 control()
5332 return NullContextmanager()
5333 else:
5334 return get_default_graph().control_dependencies(control_inputs)
5335
5336
5337class _DefaultStack(threading.local):

Callers 1

init_scopeFunction · 0.85

Calls 4

NullContextmanagerClass · 0.85
get_default_graphFunction · 0.85
executing_eagerlyMethod · 0.80
control_dependenciesMethod · 0.45

Tested by

no test coverage detected