MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _replace_global_by_local

Function _replace_global_by_local

tensorpack/graph_builder/utils.py:25–34  ·  view source on GitHub ↗
(kwargs)

Source from the content-addressed store, hash-verified

23
24
25def _replace_global_by_local(kwargs):
26 if 'collections' in kwargs:
27 collections = kwargs['collections']
28 if not collections:
29 collections = {tfv1.GraphKeys.GLOBAL_VARIABLES}
30 else:
31 collections = set(collections.copy())
32 collections.remove(tfv1.GraphKeys.GLOBAL_VARIABLES)
33 collections.add(tfv1.GraphKeys.LOCAL_VARIABLES)
34 kwargs['collections'] = list(collections)
35
36
37_module_lock = threading.Lock()

Callers 2

custom_getterFunction · 0.85
__call__Method · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected