提交 969f76c4 authored 作者: Ricardo Vieira's avatar Ricardo Vieira 提交者: Ricardo Vieira

Speedup config access

上级 b30149bf
...@@ -410,7 +410,9 @@ class ConfigParam: ...@@ -410,7 +410,9 @@ class ConfigParam:
f"The config parameter '{self.name}' was registered on a different instance of the PyTensorConfigParser." f"The config parameter '{self.name}' was registered on a different instance of the PyTensorConfigParser."
f" It is not accessible through the instance with id '{id(cls)}' because of safeguarding." f" It is not accessible through the instance with id '{id(cls)}' because of safeguarding."
) )
if not hasattr(self, "val"): try:
return self.val
except AttributeError:
try: try:
val_str = cls.fetch_val_for_key(self.name, delete_key=delete_key) val_str = cls.fetch_val_for_key(self.name, delete_key=delete_key)
self.is_default = False self.is_default = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论