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

Method _IsOpFree

tensorflow/python/ops/control_flow_ops.py:1770–1781  ·  view source on GitHub ↗

Determines if `op` needs a control dependency.

(op)

Source from the content-addressed store, hash-verified

1768 """Add a control input to the op if it only depends on loop invariants."""
1769
1770 def _IsOpFree(op):
1771 """Determines if `op` needs a control dependency."""
1772 if op.control_inputs:
1773 return False
1774 # pylint: disable=protected-access
1775 if op.graph._is_function(op.type) or op.type == "SymbolicGradient":
1776 return True
1777 # pylint: enable=protected-access
1778 for x in op.inputs:
1779 if not util.IsLoopConstantEnter(x.op):
1780 return False
1781 return True
1782
1783 if _IsOpFree(op):
1784 # pylint: disable=protected-access

Callers

nothing calls this directly

Calls 1

_is_functionMethod · 0.80

Tested by

no test coverage detected