-
Notifications
You must be signed in to change notification settings - Fork 434
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
[ONNX] Fix bugs for the onnx.OneHot
operator
#3334
Merged
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
angelz913
requested review from
rsuderman,
vivekkhandelwal1 and
renxida
and removed request for
rsuderman and
vivekkhandelwal1
May 13, 2024 19:56
renxida
approved these changes
May 14, 2024
vivekkhandelwal1
requested changes
May 14, 2024
angelz913
force-pushed
the
one-hot-remove-negative-indices
branch
from
May 14, 2024 14:17
7716da9
to
254a3bd
Compare
angelz913
force-pushed
the
one-hot-remove-negative-indices
branch
3 times, most recently
from
May 21, 2024 20:12
07ce073
to
ddda063
Compare
angelz913
changed the title
[ONNX] Convert negative indices to non-negative for
[ONNX] Fix bugs for the May 21, 2024
onnx.OneHot
operatoronnx.OneHot
operator
angelz913
force-pushed
the
one-hot-remove-negative-indices
branch
3 times, most recently
from
May 21, 2024 20:37
80fa182
to
2e95d1b
Compare
This commit fixes bugs for the onnx.OneHot operator by: 1. Converting negative indices to non-negative indices 2. Handling both int and float types for off and on values 3. Using the correct result type It also includes a new unit test.
angelz913
force-pushed
the
one-hot-remove-negative-indices
branch
from
May 21, 2024 22:49
2e95d1b
to
d520770
Compare
vivekkhandelwal1
approved these changes
May 22, 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.
LGTM
kuhar
pushed a commit
that referenced
this pull request
May 22, 2024
This PR fixes the bugs for `Torch::AtenOneHotOp` by: 1) Using `Torch::kUnknownSize` as the default value for `numClasses` in the pattern matching stage in `DecomposeAtenOneHotOp` 2) Adding `AtenIntScalarOp` to the patterns in `TorchToArith` 3) Handling both `int` and `float` types for `off` and `on` values in `TorchOnnxToTorch` conversion It also includes: 1) A new test in `TorchToArith/basic.mlir`, for `torch.aten.Int.Scalar`, and 2) A new test in `decompose-complex-ops.mlir`, for `torch.aten.one_hot` **Dependencies** This PR is dependent on #3334.
BaneTrifa
pushed a commit
to BaneTrifa/torch-mlir
that referenced
this pull request
May 24, 2024
This commit fixes the bugs for the `onnx.OneHot` operator by: 1) Converting negative indices to non-negative indices 2) Handling both `int` and `float` types for `off` and `on` values 3) Using the correct result type It also includes a new unit test.
BaneTrifa
pushed a commit
to BaneTrifa/torch-mlir
that referenced
this pull request
May 24, 2024
This PR fixes the bugs for `Torch::AtenOneHotOp` by: 1) Using `Torch::kUnknownSize` as the default value for `numClasses` in the pattern matching stage in `DecomposeAtenOneHotOp` 2) Adding `AtenIntScalarOp` to the patterns in `TorchToArith` 3) Handling both `int` and `float` types for `off` and `on` values in `TorchOnnxToTorch` conversion It also includes: 1) A new test in `TorchToArith/basic.mlir`, for `torch.aten.Int.Scalar`, and 2) A new test in `decompose-complex-ops.mlir`, for `torch.aten.one_hot` **Dependencies** This PR is dependent on llvm#3334.
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 commit fixes the bugs for the
onnx.OneHot
operator by:int
andfloat
types foroff
andon
valuesIt also includes a new unit test.