-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add Split-18: new num_outputs attribute #4358
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
onnx/defs/tensor/defs.cc
Outdated
@@ -682,7 +688,7 @@ ONNX_OPERATOR_SET_SCHEMA( | |||
")"); | |||
} | |||
} else { // no value available for 'split' | |||
int num_outputs = static_cast<int>(ctx.getNumOutputs()); | |||
int num_outputs = static_cast<int>(getAttribute(ctx, "num_outputs", 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.
Would be good to check that the attribute is specified, and produce an error message otherwise. Similarly, it may be useful to check in the then-branch that the attribute is not specified.
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, please let me know if my changes address your comment.
b4cb6f7
to
88df4af
Compare
Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
9bb4825
to
0702fab
Compare
Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
set ONNX_ML=0 | ||
|
||
# UNIX | ||
# export ONNX_ML=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.
Is that # in the second line a typo or intentional?
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.
It was a result of my failed attempt at fixing non-signed-off commit issue. My git got messed up, I'm going to open a new, clean PR. Sorry for inconvenience.
Do you need to rebase? Or, something is off, it is showing other recently merged PRs in the diff here, which is a bit confusing. |
split.reserve(ctx.getNumOutputs()); | ||
for (int i = 0; i < static_cast<int>(ctx.getNumOutputs()); i++) { | ||
split.push_back(chunk_size); | ||
const auto num_outputs_attr = ctx.getAttribute("num_outputs"); |
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.
Suggest moving the above line out of the else-branch to before the if-statement, and adding a check in the then-branch that num_outputs_attr == nullptr
(to catch the case where both are specified, which is also erroneous).
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.
I added a shape inference error in case both are specified. The PR has been moved to #4389.
I had an issue with a non-signed off commit, and then broke something trying to fix it. I'll get to fixing it today. |
Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
I moved the PR to #4389, my attempts at fixing non-signed-off commits led me to breaking my git, creating a new PR was a quicker and less messy solution. |
Signed-off-by: Przemyslaw Wysocki przemyslaw.wysocki@intel.com
Description
num_outputs
determining the number of equally sized output tensors.Motivation and Context