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

Function add_control_inputs

tensorflow/contrib/graph_editor/reroute.py:481–500  ·  view source on GitHub ↗

Add the control inputs cops to op. Warning: this function is directly manipulating the internals of the tf.Graph. Args: op: a tf.Operation to which the control inputs are added. cops: an object convertible to a list of `tf.Operation`. Raises: TypeError: if op is not a tf.Operatio

(op, cops)

Source from the content-addressed store, hash-verified

479
480
481def add_control_inputs(op, cops):
482 """Add the control inputs cops to op.
483
484 Warning: this function is directly manipulating the internals of the tf.Graph.
485
486 Args:
487 op: a tf.Operation to which the control inputs are added.
488 cops: an object convertible to a list of `tf.Operation`.
489 Raises:
490 TypeError: if op is not a tf.Operation
491 ValueError: if any cop in cops is already a control input of op.
492 """
493 if not isinstance(op, _tf_ops.Operation):
494 raise TypeError("Expected a tf.Operation, got: {}", type(op))
495 cops = _util.make_list_of_op(cops, allow_graph=False)
496 for cop in cops:
497 if cop in op.control_inputs:
498 raise ValueError("{} is already a control_input of {}".format(cop.name,
499 op.name))
500 op._add_control_inputs(cops) # pylint: disable=protected-access
501
502remove_undocumented(__name__, _allowed_symbols)

Callers

nothing calls this directly

Calls 3

typeFunction · 0.85
_add_control_inputsMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected