Skip to content

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
Contributor

@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
Contributor

snnn commented Nov 15, 2023

/azp run Windows CPU CI Pipeline

@azure-pipelines
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
@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.

6 participants