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

Method __getattr__

tensorflow/python/distribute/values.py:379–389  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

377 """A map from device to values; acts as the same type as the values."""
378
379 def __getattr__(self, name):
380 # The '_use_resource_variables' and the attrs starts with '_self' are used
381 # for restoring the saved_model proto. At the point these attrs are queried,
382 # the variable has not been initialized. Thus it should not query those of
383 # the underlying components.
384 if name.startswith("_self_") or name == "_use_resource_variables":
385 return super(DistributedDelegate, self).__getattr__(name)
386
387 # TODO(priyag): This needs to be made robust against pitfalls from mix use
388 # __getattr__ and @property. See b/120402273.
389 return getattr(self.get(), name)
390
391 def _get_as_operand(self):
392 """Returns the value for operations for the current device.

Callers

nothing calls this directly

Calls 2

__getattr__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected