Skip to content

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

Merged
yuslepukhin merged 2 commits into
mainfrom
yuslepukhin/allow_empty_shapes
Nov 16, 2023
Merged

Allow empty shapes and do not validate them for inputs/outputs#18442
yuslepukhin merged 2 commits into
mainfrom
yuslepukhin/allow_empty_shapes

Conversation

@yuslepukhin

Copy link
Copy Markdown
Contributor

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.

@wenbingl wenbingl left a comment

Copy link
Copy Markdown
Contributor

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

snnn commented Nov 15, 2023

Copy link
Copy Markdown
Contributor

/azp run Windows CPU CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
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
@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