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

Function _get_unique_variable_scope

tensorflow/python/ops/variable_scope.py:2719–2729  ·  view source on GitHub ↗

Get a name with the given prefix unique in the current variable scope.

(prefix)

Source from the content-addressed store, hash-verified

2717
2718
2719def _get_unique_variable_scope(prefix):
2720 """Get a name with the given prefix unique in the current variable scope."""
2721 var_scope_store = get_variable_scope_store()
2722 current_scope = get_variable_scope()
2723 name = current_scope.name + "/" + prefix if current_scope.name else prefix
2724 if var_scope_store.variable_scope_count(name) == 0:
2725 return prefix
2726 idx = 1
2727 while var_scope_store.variable_scope_count(name + ("_%d" % idx)) > 0:
2728 idx += 1
2729 return prefix + ("_%d" % idx)
2730
2731
2732# Named like a function for backwards compatibility with the

Callers 1

_enter_scope_uncachedMethod · 0.85

Calls 3

get_variable_scope_storeFunction · 0.85
get_variable_scopeFunction · 0.85
variable_scope_countMethod · 0.80

Tested by

no test coverage detected