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

Allow empty shapes and do not validate them for inputs/outputs #18442

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

yuslepukhin
Copy link
Member

Description

Allow empty shapes and do not validate them for inputs/outputs at the InferenceSession::ValidateInputsOutputs().

Motivation and Context

#17301 disallowed empty shapes.
However, many models depend on them as a way to pass shapes of different ranks.

Copy link
Member

@wenbingl wenbingl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Add one example, tokenization custom op the input shape could be [N, text-len], [text-len], [N, pair, text-len] to make user input are more closer to HF's one, so allowing empty shape is very helpful for these cases.

@snnn
Copy link
Member

snnn commented Nov 15, 2023

/azp run Windows CPU CI Pipeline

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yuslepukhin yuslepukhin reopened this Nov 15, 2023
@yuslepukhin yuslepukhin reopened this Nov 15, 2023
@yuslepukhin yuslepukhin merged commit b6b9aff into main Nov 16, 2023
100 of 110 checks passed
@yuslepukhin yuslepukhin deleted the yuslepukhin/allow_empty_shapes branch November 16, 2023 21:15
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
…soft#18442)

### Description
Allow empty shapes and do not validate them for inputs/outputs at the
InferenceSession::ValidateInputsOutputs().

### Motivation and Context
microsoft#17301 disallowed empty
shapes.
However, many models depend on them as a way to pass shapes of different
ranks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants