MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _VariableScopeStore

Class _VariableScopeStore

tensorflow/python/ops/variable_scope.py:1792–1812  ·  view source on GitHub ↗

A thread local store for the current variable scope and scope counts.

Source from the content-addressed store, hash-verified

1790
1791
1792class _VariableScopeStore(threading.local):
1793 """A thread local store for the current variable scope and scope counts."""
1794
1795 def __init__(self):
1796 super(_VariableScopeStore, self).__init__()
1797 self.current_scope = VariableScope(False)
1798 self.variable_scopes_count = {}
1799
1800 def open_variable_scope(self, scope_name):
1801 if scope_name in self.variable_scopes_count:
1802 self.variable_scopes_count[scope_name] += 1
1803 else:
1804 self.variable_scopes_count[scope_name] = 1
1805
1806 def close_variable_subscopes(self, scope_name):
1807 for k in list(self.variable_scopes_count.keys()):
1808 if scope_name is None or k.startswith(scope_name + "/"):
1809 self.variable_scopes_count[k] = 0
1810
1811 def variable_scope_count(self, scope_name):
1812 return self.variable_scopes_count.get(scope_name, 0)
1813
1814
1815def get_variable_scope_store():

Callers 1

get_variable_scope_storeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected