Skip to content

Commit 9ea9bb2

Browse files
committed
Update ssim.py
1 parent ed0b99f commit 9ea9bb2

File tree

1 file changed

+1
-1
lines changed
  • src/torchmetrics/functional/image

1 file changed

+1
-1
lines changed

src/torchmetrics/functional/image/ssim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def _ssim_update(
111111
raise ValueError(f"Expected `sigma` to have positive number. Got {sigma}.")
112112

113113
if data_range is None:
114-
data_range = max(preds.max() - preds.min(), target.max() - target.min())
114+
data_range = max(preds.max() - preds.min(), target.max() - target.min()).item()
115115
elif isinstance(data_range, tuple):
116116
preds = torch.clamp(preds, min=data_range[0], max=data_range[1])
117117
target = torch.clamp(target, min=data_range[0], max=data_range[1])

0 commit comments

Comments
 (0)