base
This commit is contained in:
@@ -2,7 +2,7 @@ import inspect
|
||||
from omegaconf.dictconfig import DictConfig
|
||||
from omegaconf import OmegaConf
|
||||
from types import ModuleType
|
||||
|
||||
import warnings
|
||||
|
||||
class _Registry:
|
||||
def __init__(self, name):
|
||||
@@ -51,6 +51,12 @@ class _Registry:
|
||||
else:
|
||||
raise TypeError(f'cfg must be a dict or a str, but got {type(cfg)}')
|
||||
|
||||
for k in args:
|
||||
assert isinstance(k, str)
|
||||
if k.startswith("_"):
|
||||
warnings.warn(f"got param start with `_`: {k}, will remove it")
|
||||
args.pop(k)
|
||||
|
||||
if not (isinstance(default_args, dict) or default_args is None):
|
||||
raise TypeError('default_args must be a dict or None, '
|
||||
f'but got {type(default_args)}')
|
||||
|
||||
Reference in New Issue
Block a user