Skip to content

Conversation

p-wysocki
Copy link
Contributor

@p-wysocki p-wysocki commented Jul 13, 2022

Signed-off-by: Przemyslaw Wysocki przemyslaw.wysocki@intel.com

Description

  • New optional Split attribute num_outputs determining the number of equally sized output tensors.

Motivation and Context

@p-wysocki p-wysocki changed the title Add Split-18: new num_outputs attribute [WIP] Add Split-18: new num_outputs attribute Jul 13, 2022
@@ -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));
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@p-wysocki p-wysocki force-pushed the split_num_outputs branch from b4cb6f7 to 88df4af Compare July 21, 2022 10:15
@p-wysocki p-wysocki changed the title [WIP] Add Split-18: new num_outputs attribute Add Split-18: new num_outputs attribute Jul 21, 2022
@p-wysocki p-wysocki marked this pull request as ready for review July 21, 2022 10:16
@p-wysocki p-wysocki requested review from a team as code owners July 21, 2022 10:16
Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
@p-wysocki p-wysocki force-pushed the split_num_outputs branch from 9bb4825 to 0702fab Compare July 27, 2022 19:16
Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
@gramalingam gramalingam added the topic: operator Issues related to ONNX operators label Jul 27, 2022
set ONNX_ML=0

# UNIX
# export ONNX_ML=0
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@gramalingam
Copy link
Contributor

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");
Copy link
Contributor

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).

Copy link
Contributor Author

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.

@p-wysocki
Copy link
Contributor Author

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.

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>
@p-wysocki
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: operator Issues related to ONNX operators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants