Skip to content

Commit

Permalink
Fixed metadata initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoTrizio committed Nov 14, 2024
1 parent d50c12b commit af5d238
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mlcolvar/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def __init__(self, dictionary: dict=None, feature_names = None, metadata: dict =
if len(dictionary) == 0:
raise ValueError("Empty datasets are not supported")

# initialize metadata as dict
if metadata is None:
metadata = {}

# convert to torch.Tensors
for key, val in dictionary.items():
if not isinstance(val, torch.Tensor):
Expand Down

0 comments on commit af5d238

Please sign in to comment.