Skip to content

Commit

Permalink
Log max diff in AITTestCase (facebookincubator#817)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: facebookincubator#817

Differential Revision: D47283465

fbshipit-source-id: 71a04b2fdaf9c0c6a2a53537789708eb87aa98bb
  • Loading branch information
henryhu6 authored and facebook-github-bot committed Jul 8, 2023
1 parent b714221 commit 9aa173d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fx2ait/fx2ait/tools/common_fx2ait.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,12 @@ def run_test(
out = map_aggregate(
out, lambda output: output.permute(*permute_outputs)
)
out = out.cpu()
if out.numel() != 0:
max_diff = torch.max(torch.abs(out - ref))
logger.info(f"Max diff = {max_diff}")
torch.testing.assert_close(
out.cpu(),
out,
ref,
rtol=rtol,
atol=atol,
Expand Down

0 comments on commit 9aa173d

Please sign in to comment.