feat(atenlib): index_select; trace_only ops#274
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.
Otherwise, is index expected to be 1-dimensional? Or, can it have any other rank?
There was a problem hiding this comment.
Yes, it should be 1d I think.
There was a problem hiding this comment.
should I do op.Reshape(index, [-1]) instead?
There was a problem hiding this comment.
Yes, if we expect it to be 0d or 1d, I think reshape, as you mention, is a better option.
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_onlyargument 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.