-
Notifications
You must be signed in to change notification settings - Fork 634
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
support for zero dimension tensors as an input for cat operation #2354
Merged
Conversation
This file contains 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
junpeiz
reviewed
Oct 2, 2024
@pytest.mark.parametrize( | ||
"compute_unit, backend, frontend", itertools.product(compute_units, backends, frontends) | ||
) | ||
def test_cat_with_empty_tensors(self, compute_unit, backend, frontend): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Will approve the PR after confirming green CI.
junpeiz
previously approved these changes
Oct 3, 2024
junpeiz
requested review from
TobyRoseman,
aseemw,
YifanShenSZ and
jakesabathia2
October 3, 2024 19:01
jakesabathia2
previously approved these changes
Oct 3, 2024
junpeiz
approved these changes
Oct 7, 2024
jirmasek
force-pushed
the
dev/jim/133784401-cat
branch
from
October 7, 2024 17:44
6780c1f
to
e9f90b1
Compare
jakesabathia2
approved these changes
Oct 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this amazing PR!
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.
This PR introduces support for conversion of torch cat operation that has as an input a list of empty tensors (tensors with one of its dimensions being zero).
Without this fix we'd filter all these empty tensors and subsequently fail on determining the dtype of the output (as we'd have nothing in the input). We basically keep at least one of the empty tensors in the input to make sure dtype information is still available.
Fixes the bug in #2296.
CI pipeline: https://gitlab.com/coremltools1/coremltools/-/pipelines/1479158242