MCPcopy Index your code
hub / github.com/tensorflow/tensorboard / LazyModule

Class LazyModule

tensorboard/lazy.py:63–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 # load_once() the first time it's needed. The class is nested so we can close
62 # over load_once() and avoid polluting the module's attrs with our own state.
63 class LazyModule(types.ModuleType):
64 def __getattr__(self, attr_name):
65 return getattr(load_once(self), attr_name)
66
67 def __dir__(self):
68 return dir(load_once(self))
69
70 def __repr__(self):
71 if load_once.loaded:
72 return "<%r via LazyModule (loaded)>" % load_once(self)
73 return (
74 "<module %r via LazyModule (not yet loaded)>"
75 % self.__name__
76 )
77
78 return LazyModule(name)
79

Callers 1

wrapperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…