You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think I see why in principle FrozenConfigDict can't include fields which are tuples of frozen config dicts, given that Python tuples themselves are already frozen. Is is just a matter of not adding support yet, or is there something more fundamental?
For example,
FrozenConfigDict({'a': ({'b': 1}, {'b': 2})})
gives the error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-133-a093d88df5a2> in <module>
----> 1 c=FrozenConfigDict({'a': ({'b': 1}, {'b': 2})})
~/opt/anaconda3/lib/python3.7/site-packages/ml_collections/config_dict/config_dict.py in __init__(self, initial_dictionary, type_safe)
1635 type_safe=type_safe)
1636
-> 1637 _frozenconfigdict_valid_input(initial_configdict)
1638 # This will define the self._configdict attribute
1639 _frozenconfigdict_fill_seed(self, initial_configdict)
~/opt/anaconda3/lib/python3.7/site-packages/ml_collections/config_dict/config_dict.py in _frozenconfigdict_valid_input(obj, ancestor_list)
1418 if isinstance(obj, ConfigDict):
1419 for value in obj.values():
-> 1420 _frozenconfigdict_valid_input(value, ancestor_list)
1421 elif isinstance(obj, FieldReference):
1422 _frozenconfigdict_valid_input(obj.get(), ancestor_list)
~/opt/anaconda3/lib/python3.7/site-packages/ml_collections/config_dict/config_dict.py in _frozenconfigdict_valid_input(obj, ancestor_list)
1424 for element in obj:
1425 if isinstance(element, (dict, ConfigDict, FieldReference)):
-> 1426 raise ValueError('Bad FrozenConfigDict initialization: Cannot '
1427 'contain a dict, ConfigDict, or FieldReference '
1428 'within a list or tuple.')
ValueError: Bad FrozenConfigDict initialization: Cannot contain a dict, ConfigDict, or FieldReference within a list or tuple.
The text was updated successfully, but these errors were encountered:
Thanks for open-sourcing this nice package!
I don't think I see why in principle FrozenConfigDict can't include fields which are tuples of frozen config dicts, given that Python tuples themselves are already frozen. Is is just a matter of not adding support yet, or is there something more fundamental?
For example,
gives the error:
The text was updated successfully, but these errors were encountered: