MCPcopy Create free account
hub / github.com/apple/axlearn / wrapped_setattr

Function wrapped_setattr

axlearn/common/config.py:816–822  ·  view source on GitHub ↗
(self, key: str, value)

Source from the content-addressed store, hash-verified

814 orig_getattr = attr_cls.__getattr__
815
816 def wrapped_setattr(self, key: str, value):
817 if key.startswith("__"):
818 self.__dict__[key] = value
819 else:
820 if key not in _attr_fields_dict_cache(type(self)):
821 raise UnknownFieldError(self._key_error_string(key))
822 orig_setattr(self, key, value)
823
824 def wrapped_getattr(self, key: str) -> Any:
825 if key.startswith("__"):

Callers

nothing calls this directly

Calls 3

_attr_fields_dict_cacheFunction · 0.85
UnknownFieldErrorClass · 0.85
_key_error_stringMethod · 0.80

Tested by

no test coverage detected