-
Notifications
You must be signed in to change notification settings - Fork 64
feat(atenlib): index_select; trace_only ops #274
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
Conversation
cc @BowenBao |
Sounds like a restriction posed from onnx script function. Is there something fundamentally blocking from mixing the order of inputs and attributes? cc @gramalingam |
No, I don't think there is anything fundamentally blocking it. But we need to add the logic to onnxscript translator to process the parameters accordingly, so it is a missing feature. |
# index_select(Tensor self, int dim, Tensor index) -> Tensor | ||
|
||
raise NotImplementedError() | ||
if op.Size(op.Shape(index)) == 0: |
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.
Otherwise, is index
expected to be 1-dimensional? Or, can it have any other rank?
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.
Yes, it should be 1d I think.
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.
should I do op.Reshape(index, [-1])
instead?
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.
Yes, if we expect it to be 0d or 1d, I think reshape, as you mention, is a better option.
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.
Done. thanks!
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.
Approved.
Codecov Report
@@ Coverage Diff @@
## main #274 +/- ##
==========================================
+ Coverage 72.97% 73.04% +0.07%
==========================================
Files 95 95
Lines 9113 9131 +18
==========================================
+ Hits 6650 6670 +20
+ Misses 2463 2461 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Implement
aten_index_select
; enable tests for transpose.This change also added the
trace_only
argument to mark functions as trace only to work around functions that cannot be compiled. The logic can then be tested, but the argument should be removed later when onnxscript extends support for the syntax.