Add function-body to SoftmaxGrad#6988
Merged
Merged
Conversation
ke1337
reviewed
Mar 11, 2021
| input_types.emplace_back(type); | ||
| } else | ||
| input_types.emplace_back(); | ||
| } |
Contributor
There was a problem hiding this comment.
nit: May use node.ForEachDef() for simplicity. It handles non-exist cases. #Resolved
Contributor
Author
There was a problem hiding this comment.
We don't want to skip the non-exist cases here: we want to push a default-value for these cases. So, I am not sure we can do that. #Resolved
ke1337
reviewed
Mar 12, 2021
| for (const auto& attr : node.attributes) { | ||
| *(np->add_attribute()) = attr.proto; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
np->CopyFrom()? #Resolved
Contributor
Author
There was a problem hiding this comment.
The source is a NodeDef, not a NodeProto. #Resolved
ke1337
reviewed
Mar 12, 2021
Member
|
LGTM |
souptc
approved these changes
Mar 25, 2021
| testCase.opsets[kOnnxDomain] = 13; | ||
| testCase.opsets[kMSDomain] = 1; | ||
|
|
||
| auto model2 = testCase.CreateModel(); |
This file contains hidden or 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
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.
Description:
(a) Add function-body to the SoftmaxGrad schema.
(b) Add test-cases to validate the function-body by running the op and the expanded function-body using the CPU provider to establish equivalence.
(c) Add type-context when calling the function-body-builder (which will be required for other ops for typed constants).
Motivation and Context
This will enable, for example, translation of ONNX graphs containing calls to SoftmaxGrad to ONNX-MLIR using the function mechanism.