Allow users to 'disable' the name scope behaviour. This sets the CurrentNameScope() to None, so that the field is not set in CreateOperator(...), etc.
()
| 88 | |
| 89 | @contextlib.contextmanager |
| 90 | def EmptyNameScope(): |
| 91 | """ |
| 92 | Allow users to 'disable' the name scope behaviour. |
| 93 | |
| 94 | This sets the CurrentNameScope() to None, so that the field is |
| 95 | not set in CreateOperator(...), etc. |
| 96 | """ |
| 97 | old_scope = CurrentNameScope() |
| 98 | try: |
| 99 | _threadlocal_scope.namescope = '' |
| 100 | yield |
| 101 | finally: |
| 102 | _threadlocal_scope.namescope = old_scope |
| 103 | return |
| 104 | |
| 105 | |
| 106 | @contextlib.contextmanager |
nothing calls this directly
no test coverage detected
searching dependent graphs…