-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix Slice shape inference in the case of dynamic inputs #5475
Conversation
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 should be worthy to fix the same issue in Slice-11 and Slice-10 as well?
Lines 1050 to 1053 in 025a911
if (!startsInitializer || !endsInitializer || (hasInputShape(ctx, 3) && !ctx.getInputData(3)) || | |
(hasInputShape(ctx, 4) && !ctx.getInputData(4))) { | |
return; | |
} |
@onnx/sig-operators-approvers for approval |
Could you fix dco by signing the new commit? |
Signed-off-by: Atanas Dimitrov <atanas.dimitrov@quantco.com>
@justinchuby could we please add this to the merge queue? |
We need an additional approval from @onnx/sig-operators-approvers |
@@ -958,6 +958,11 @@ ONNX_OPERATOR_SET_SCHEMA( | |||
|
|||
if (!startsInitializer || !endsInitializer || (hasInputShape(ctx, 3) && !ctx.getInputData(3)) || | |||
(hasInputShape(ctx, 4) && !ctx.getInputData(4))) { | |||
const auto input_rank = ctx.getInputType(0)->tensor_type().shape().dim_size(); |
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.
This looks good, thanks! Unrelated to this change, I wonder if we should change the hasInputShape
in the previous two lines to hasInput
? We need to only check if the starts/ends inputs are supplied, not whether we know their shape.
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.
Failed. Reverting
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.
LGTM. I think we might be able to fix another minor issue at the same time, as mentioned in the comments.
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
### Description Slice shape-inference didn't work when the start or stop inputs were not defined. ### Motivation and Context This contributes to making the type and shape inference more complete. --------- Signed-off-by: Atanas Dimitrov <atanas.dimitrov@quantco.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
Description
Slice shape-inference didn't work when the start or stop inputs were not defined.
Motivation and Context
This contributes to making the type and shape inference more complete.