parameters: (value)
return_statement: return op if _IsLoopConstantEnter(op) else None
docstring: Return the enter op if we can infer `value` to be a loop invariant.
docstring_summary: Return the enter op if we can infer `value` to be a loop invariant.
docstring_tokens: Return the enter op if we can infer value to be a loop invariant .
function: def _GetLoopConstantEnter(value):
    """Return the enter op if we can infer `value` to be a loop invariant."""
    id_ops = {"Switch", "RefSwitch", "Identity", "RefIdentity"}
    op = value.op
    while op.type in id_ops:
      op = op.inputs[0].op
    return op if _IsLoopConstantEnter(op) else None
function_tokens: def _GetLoopConstantEnter ( value ) : id_ops = { "Switch" , "RefSwitch" , "Identity" , "RefIdentity" } op = value . op while op . type in id_ops : op = op . inputs [ 0 ] . op return op if _IsLoopConstantEnter ( op ) else None