Skip to content

Commit

Permalink
Fix l2l.utils.flatten_config.
Browse files Browse the repository at this point in the history
  • Loading branch information
seba-1511 committed Jun 20, 2023
1 parent 2cdfeed commit e56657c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions learn2learn/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ def flatten_config(args, prefix=None):
return flat_args
elif dataclasses.is_dataclass(args):
keys = dataclasses.fields(args)
def getvalue(x): getattr(args, x.name)
def getvalue(x): return getattr(args, x.name)
elif isinstance(args, dict):
keys = args.keys()
def getvalue(x): args[x]
def getvalue(x): return args[x]
else:
raise 'Unknown args'
for key in keys:
Expand Down

0 comments on commit e56657c

Please sign in to comment.