Skip to content

Commit

Permalink
Correctly initlalize self.reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejdolicki committed Jan 24, 2023
1 parent 5a22643 commit f94b9e1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/torchmetrics/classification/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,8 @@ def __init__(
raise ValueError(f"The `average` has to be one of {allowed_average}, got {average}.")

_reduce_options = (AverageMethod.WEIGHTED, AverageMethod.NONE, None)
if "reduce" not in kwargs:
kwargs["reduce"] = AverageMethod.MACRO if average in _reduce_options else average
if "mdmc_reduce" not in kwargs:
kwargs["mdmc_reduce"] = mdmc_average

self.reduce = average
self.reduce = AverageMethod.MACRO if average in _reduce_options else average
self.mdmc_reduce = mdmc_average
self.num_classes = num_classes
self.threshold = threshold
Expand Down

0 comments on commit f94b9e1

Please sign in to comment.