Skip to content

Commit 294ba8b

Browse files
authored
Update ssim.py
1 parent 4faa076 commit 294ba8b

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)