Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions onnx_diagnostic/helpers/torch_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,16 @@ def study_discrepancies(
"""
Computes different metrics for the discrepancies.
Returns graphs.

.. plot::
:include-source:

import torch
from onnx_diagnostic.helpers.torch_helper import study_discrepancies

t1 = torch.randn((512, 1024)) * 10
t2 = t1 + torch.randn((512, 1024))
study_discrepancies(t1, t2, title="Random noise")
"""
assert t1.dtype == t2.dtype, f"Type mismatch {t1.dtype} != {t2.dtype}"
assert t1.shape == t2.shape, f"Shape mismatch {t1.shape} != {t2.shape}"
Expand Down
Loading