MCPcopy Create free account
hub / github.com/XingangPan/DragGAN / get_obj_from_module

Function get_obj_from_module

dnnlib/util.py:277–284  ·  view source on GitHub ↗

Traverses the object name and returns the last (rightmost) python object.

(module: types.ModuleType, obj_name: str)

Source from the content-addressed store, hash-verified

275
276
277def get_obj_from_module(module: types.ModuleType, obj_name: str) -> Any:
278 """Traverses the object name and returns the last (rightmost) python object."""
279 if obj_name == '':
280 return module
281 obj = module
282 for part in obj_name.split("."):
283 obj = getattr(obj, part)
284 return obj
285
286
287def get_obj_by_name(name: str) -> Any:

Callers 2

get_module_from_obj_nameFunction · 0.70
get_obj_by_nameFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected