MCPcopy Index your code
hub / github.com/pytorch/pytorch / EmptyNameScope

Function EmptyNameScope

caffe2/python/scope.py:90–103  ·  view source on GitHub ↗

Allow users to 'disable' the name scope behaviour. This sets the CurrentNameScope() to None, so that the field is not set in CreateOperator(...), etc.

()

Source from the content-addressed store, hash-verified

88
89@contextlib.contextmanager
90def 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

Callers

nothing calls this directly

Calls 1

CurrentNameScopeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…