def _get_thread_name_scope(): """ Returns: NameScope: Thread-local NameScope. """ try: name_scope = get_thread_state().name_scope except AttributeError: name_scope = [None] get_thread_state().name_scope = name_scope return name_scope
def _get_thread_name_scope(): """ Returns: NameScope: Thread-local NameScope. """ return get_thread_state().name_scope
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ---------------------------------------------------------------------------- from contextlib import contextmanager from functools import wraps from weakref import WeakValueDictionary from builtins import next, object from ngraph.util.threadstate import get_thread_state get_thread_state().name_scope = [None] def _get_thread_name_scope(): """ Returns: NameScope: Thread-local NameScope. """ return get_thread_state().name_scope def get_current_name_scope(): """ Return: