MCPcopy Create free account
hub / github.com/OpenGVLab/DragGAN / _module_to_src

Function _module_to_src

draggan/stylegan2/torch_utils/persistence.py:206–214  ·  view source on GitHub ↗

r"""Query the source code of a given Python module.

(module)

Source from the content-addressed store, hash-verified

204#----------------------------------------------------------------------------
205
206def _module_to_src(module):
207 r"""Query the source code of a given Python module.
208 """
209 src = _module_to_src_dict.get(module, None)
210 if src is None:
211 src = inspect.getsource(module)
212 _module_to_src_dict[module] = src
213 _src_to_module_dict[src] = module
214 return src
215
216def _src_to_module(src):
217 r"""Get or create a Python module for the given source code.

Callers 1

persistent_classFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected