Add permute and pow ops and fix attribute value issue.#293
Add permute and pow ops and fix attribute value issue.#293fatcat-z merged 9 commits intomicrosoft:mainfrom fatcat-z:new_ops_1
Conversation
justinchuby
left a comment
There was a problem hiding this comment.
lgtm. I would wait for @gramalingam
Codecov Report
@@ Coverage Diff @@
## main #293 +/- ##
==========================================
+ Coverage 73.04% 73.13% +0.08%
==========================================
Files 97 97
Lines 9461 9472 +11
==========================================
+ Hits 6911 6927 +16
+ Misses 2550 2545 -5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
Hi, a quick question: if I understand right, the code change converts attribute values that are tensors into numpy arrays. First, I don't think that would fix issue 287 (completely). That's not a problem, just want to clarify that the PR description is a bit misleading. I believe we will still need to do something extra to resolve 287 fully. Or, did I misunderstand? Maybe this change fixes the issue for a particular example? Can you point me to the example where this is used? I don't see it in this PR's changes. Thanks. |
In aten_permute() method, the value of dims will be changed to tensors which are not expected by onnx.helper.make_attribute() function. In eager mode, when we call an aten_xxx() method, all of positional inputs of it will be changed to tensors by _adapt_to_eager_mode() method. But inside the function, we still need to keep some of inputs to be a Numpy value (in aten_permute, it is 'dims') so that we can pass it into ONNX op as an attribute. This will only happen in eager mode because _adapt_to_eager_mode will only be called in such mode. Probably I need to update the #287 for a clarification? |
Signed-off-by: Jay Zhang <jiz@microsoft.com>
Signed-off-by: Jay Zhang <jiz@microsoft.com>
Signed-off-by: Jay Zhang <jiz@microsoft.com>
Signed-off-by: Jay Zhang <jiz@microsoft.com>
Signed-off-by: Jay Zhang <jiz@microsoft.com>
Ok. My main question is whether this positional input of the aten_xxx() method is supposed to be an attribute (of aten_xxx) or an input (of aten_xxx)? I understand the first case: the problem happens if attributes are passed in positionally instead of as a keyword-argument. We can fix this. The second case, however, cannot be supported in ONNX. Specifically, in ONNX, there is no way to convert an input (which is not statically known) into an attribute. I just want to clarify this ... we should NOT be writing such functions. |
|
In the first case (where |
There was a problem hiding this comment.
Could you help me understand why this is needed better?
There was a problem hiding this comment.
This was not introduced by this PR, it was submitted by another PR #304
Uh oh!
There was an error while loading. Please reload this page.