Skip to content

Commit

Permalink
more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki committed Oct 18, 2024
1 parent 47c294e commit c5e7b26
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/unittests/_helpers/testers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ def _assert_allclose(tm_result: Any, ref_result: Any, atol: float = 1e-8, key: O
"""Recursively assert that two results are within a certain tolerance."""
# single output compare
if isinstance(tm_result, Tensor):
print("TM", tm_result)
print("REF", ref_result)
assert np.allclose(
tm_result.detach().cpu().numpy() if isinstance(tm_result, Tensor) else tm_result,
ref_result.detach().cpu().numpy() if isinstance(ref_result, Tensor) else ref_result,
atol=atol,
equal_nan=True,
)
), f"TM: {tm_result}, REF: {ref_result}"
# multi output compare
elif isinstance(tm_result, Sequence):
for pl_res, ref_res in zip(tm_result, ref_result):
Expand Down

0 comments on commit c5e7b26

Please sign in to comment.