Unverified Commit 872804f1 authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

fix ImagePair MAE comparison (#7477)

parent 0387b882
...@@ -292,7 +292,8 @@ class ImagePair(TensorLikePair): ...@@ -292,7 +292,8 @@ class ImagePair(TensorLikePair):
actual, expected = self._equalize_attributes(actual, expected) actual, expected = self._equalize_attributes(actual, expected)
if self.mae: if self.mae:
actual, expected = self._promote_for_comparison(actual, expected) if actual.dtype is torch.uint8:
actual, expected = actual.to(torch.int), expected.to(torch.int)
mae = float(torch.abs(actual - expected).float().mean()) mae = float(torch.abs(actual - expected).float().mean())
if mae > self.atol: if mae > self.atol:
self._fail( self._fail(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment