Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Create minifier to identify errors #163

Merged
merged 6 commits into from
Aug 21, 2024
Merged

Create minifier to identify errors #163

merged 6 commits into from
Aug 21, 2024

Conversation

justinchuby
Copy link
Owner

@justinchuby justinchuby commented Aug 21, 2024

Expose the verification module

@justinchuby justinchuby enabled auto-merge (squash) August 21, 2024 01:03
@justinchuby justinchuby merged commit 82d6c02 into main Aug 21, 2024
7 checks passed
@justinchuby justinchuby deleted the minifier branch August 21, 2024 01:05
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 18.43972% with 115 lines in your changes missing coverage. Please review.

Project coverage is 59.02%. Comparing base (2ba6fac) to head (9c5e3fe).
Report is 1 commits behind head on main.

Files Patch % Lines
src/torch_onnx/_verification.py 17.26% 112 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
- Coverage   61.08%   59.02%   -2.07%     
==========================================
  Files          22       22              
  Lines        2850     2987     +137     
  Branches      610      635      +25     
==========================================
+ Hits         1741     1763      +22     
- Misses        920     1032     +112     
- Partials      189      192       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@justinchuby
Copy link
Owner Author

Fixes #162

def _compare_tensors(
expected: torch.Tensor,
actual: torch.Tensor,
) -> tuple[float, float]:
# Move tensors to the same device
expected = expected.detach().cpu()
actual = actual.detach().cpu()
if expected.dtype == torch.bool:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to compare the dtype to make sure they are equal before we compare their values?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory no because ort would have complained already. But we could check

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants