Skip to content
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

Check whether input type is missing for function shape inference #4123

Merged
merged 3 commits into from
Apr 12, 2022

Conversation

jcwchen
Copy link
Member

@jcwchen jcwchen commented Apr 9, 2022

Description
To fix crash, check whether input type is missing for function shape inference

Motivation and Context
Shape inference for function assumes input type will be always exist:

types_cache[i] = *ctx.getInputType(i);
. However, if input type is missing, shape inference will crash. It should first examine whether input type exists. Ideally every type should be provided in ONNX, but if there are some custom operators before this function node, it is possible that such a type is missing without defined opset schema. At least shape inference should not crash with this case.

cc @yufenglee

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
@jcwchen jcwchen added the shape inference Issues related to shape inference label Apr 9, 2022
@jcwchen jcwchen requested a review from a team as a code owner April 9, 2022 23:26
@jcwchen jcwchen enabled auto-merge (squash) April 12, 2022 21:17
@jcwchen jcwchen merged commit 0978a02 into onnx:main Apr 12, 2022
@jcwchen jcwchen deleted the jcw/function-crash branch April 13, 2022 21:25
broune pushed a commit to broune/onnx that referenced this pull request May 6, 2023
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

Co-authored-by: G. Ramalingam <grama@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shape inference Issues related to shape inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants