Skip to content

Commit

Permalink
dev(BaseMetric): set dataset_meta copy
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-tong committed Sep 13, 2022
1 parent 974ca9a commit 3baeae6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mmeval/core/base_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def dataset_meta(self) -> Optional[Dict]:
@dataset_meta.setter
def dataset_meta(self, dataset_meta: Optional[Dict]) -> None:
"""Set the dataset meta information to the metric."""
self._dataset_meta = dataset_meta
if dataset_meta is None:
self._dataset_meta = dataset_meta
else:
self._dataset_meta = dataset_meta.copy()

@property
def name(self) -> str:
Expand Down

0 comments on commit 3baeae6

Please sign in to comment.