Skip to content

Commit

Permalink
fix dict case
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki authored and Borda committed Sep 11, 2024
1 parent c7e722b commit 640c664
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/unittests/_helpers/testers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _assert_allclose(tm_result: Any, ref_result: Any, atol: float = 1e-8, key: O
if key is None:
raise KeyError("Provide Key for Dict based metric results.")
assert np.allclose(
tm_result[key].detach().cpu().numpy() if isinstance(tm_result, Tensor) else tm_result[key],
tm_result[key].detach().cpu().numpy() if isinstance(tm_result[key], Tensor) else tm_result[key],
ref_result.detach().cpu().numpy() if isinstance(ref_result, Tensor) else ref_result,
atol=atol,
equal_nan=True,
Expand Down

0 comments on commit 640c664

Please sign in to comment.