-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Allow 1D vector for w_scale in QLinearConv #6460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expands TestReferenceEvaluator.test_qlinearconv with a subTest that has a 1D vector for w_scale. It's compared against ONNXRuntime, which already supports this. Signed-off-by: Maxwell D Collins <mcollins@cs.wisc.edu>
By checking whether it's a 1D vector, and if so expanding the shape so that it will broadcast to output channels correctly. Signed-off-by: Maxwell D Collins <mcollins@cs.wisc.edu>
498319a
to
adc795e
Compare
xadupre
approved these changes
Oct 14, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6460 +/- ##
==========================================
+ Coverage 57.24% 57.36% +0.11%
==========================================
Files 507 507
Lines 31442 31502 +60
Branches 3541 3544 +3
==========================================
+ Hits 18000 18072 +72
+ Misses 12593 12581 -12
Partials 849 849 ☔ View full report in Codecov by Sentry. |
justinchuby
reviewed
Oct 15, 2024
Also fixing the wording on one of the ValueError messages en passant Signed-off-by: Maxwell D Collins <mcollins@cs.wisc.edu>
97ec4a8
to
2d8257d
Compare
Signed-off-by: Maxwell D Collins <mcollins@cs.wisc.edu>
a2d9c25
to
61cd627
Compare
Signed-off-by: Maxwell D Collins <mcollins@cs.wisc.edu>
Move test cases for QLinearConv that do not depend on programmatically- constructed inputs to their own test case that does not require ONNXRuntime. This is expected to allow the coverage tool be able to tell that there is test coverage here. Signed-off-by: Maxwell D Collins <mcollins@cs.wisc.edu>
xadupre
approved these changes
Oct 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This handles the case that the
w_scale
is a 1-D vector in theReferenceEvaluator
implementation of theQLinearConv
op. It first checks ifw_scale
is a 1-D tensor. If it is, then this new branch adds dimensions it so that it will broadcast correctly to output channels in scaling the result of the QLinearConv.Motivation and Context
#6428
Documentation for QLinearConv (https://github.com/onnx/onnx/blob/main/docs/Operators.md#QLinearConv)
states of the input
w_scale
that:This change ensures the reference evaluator has more complete support of this op. Currently: passing a 1-D tensor for
w_scale
will raise an error like:This PR adds a unit test that will trigger this error in the old op implementation.