Return the enter op if we can infer `value` to be a loop invariant.
(value)
| 169 | |
| 170 | |
| 171 | def GetLoopConstantEnter(value): |
| 172 | """Return the enter op if we can infer `value` to be a loop invariant.""" |
| 173 | id_ops = {"Switch", "RefSwitch", "Identity", "RefIdentity"} |
| 174 | op = value.op |
| 175 | while op.type in id_ops: |
| 176 | op = op.inputs[0].op |
| 177 | return op if IsLoopConstantEnter(op) else None |
| 178 | |
| 179 | |
| 180 | def GetOutputContext(op): |
nothing calls this directly
no test coverage detected