Skip to content

Commit

Permalink
Fix to dict
Browse files Browse the repository at this point in the history
  • Loading branch information
HAOCHENYE committed Jan 2, 2024
1 parent 369f15e commit 08e21e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mmengine/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
def _lazy2string(cfg_dict, dict_type=None):
if isinstance(cfg_dict, dict):
dict_type = dict_type or type(cfg_dict)
return dict_type({k: _lazy2string(v) for k, v in dict.items(cfg_dict)})
return dict_type(
{k: _lazy2string(v, dict_type)
for k, v in dict.items(cfg_dict)})
elif isinstance(cfg_dict, (tuple, list)):
return type(cfg_dict)(_lazy2string(v) for v in cfg_dict)
elif isinstance(cfg_dict, (LazyAttr, LazyObject)):
Expand Down

0 comments on commit 08e21e8

Please sign in to comment.