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

Method _load

tensorflow/python/util/lazy_loader.py:42–59  ·  view source on GitHub ↗

Load the module and insert it into the parent's globals.

(self)

Source from the content-addressed store, hash-verified

40 super(LazyLoader, self).__init__(name)
41
42 def _load(self):
43 """Load the module and insert it into the parent's globals."""
44 # Import the target module and insert it into the parent's namespace
45 module = importlib.import_module(self.__name__)
46 self._parent_module_globals[self._local_name] = module
47
48 # Emit a warning if one was specified
49 if self._warning:
50 logging.warning(self._warning)
51 # Make sure to only warn once.
52 self._warning = None
53
54 # Update this object's dict so that if someone keeps a reference to the
55 # LazyLoader, lookups are efficient (__getattr__ is only called on lookups
56 # that fail).
57 self.__dict__.update(module.__dict__)
58
59 return module
60
61 def __getattr__(self, item):
62 module = self._load()

Callers 2

__getattr__Method · 0.95
__dir__Method · 0.95

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected