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

Generalize input/output number check in shape inference #6005

Merged
merged 6 commits into from
Mar 19, 2024

Conversation

OYCN
Copy link
Contributor

@OYCN OYCN commented Mar 9, 2024

Description

  • Add OpSchema::VerifyInputNum and OpSchema::VerifyOutputNum methods. The logic has been moved from OpSchema::Verify.
  • Replaced the input/output number check logic in OpSchema::CheckInputOutputType with calls to the new interfaces.
  • Without using the Node(domain::op_type::version) string pattern in OpSchema::CheckInputOutputType when calling fail_check, as the op_type will be displayed by the shape inference common exception. Otherwise, it would appear redundant.

Motivation and Context

follow-up #5990

resolve #5993

Signed-off-by: opluss <opluss@qq.com>
Copy link

codecov bot commented Mar 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.81%. Comparing base (6eb45c0) to head (da957ff).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6005   +/-   ##
=======================================
  Coverage   56.81%   56.81%           
=======================================
  Files         506      506           
  Lines       30370    30370           
  Branches     4592     4592           
=======================================
  Hits        17256    17256           
  Misses      12285    12285           
  Partials      829      829           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OYCN OYCN marked this pull request as ready for review March 10, 2024 08:06
@OYCN OYCN requested a review from a team as a code owner March 10, 2024 08:06
Copy link
Contributor

@justinchuby justinchuby left a comment

Choose a reason for hiding this comment

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

Thank you! Very nice refactoring. Some minor comments.

onnx/defs/schema.cc Outdated Show resolved Hide resolved
onnx/defs/schema.cc Outdated Show resolved Hide resolved
onnx/defs/schema.h Outdated Show resolved Hide resolved
onnx/defs/schema.cc Show resolved Hide resolved
onnx/defs/schema.cc Show resolved Hide resolved
@justinchuby justinchuby self-assigned this Mar 12, 2024
 - using `string_view`
 - move `VerifyInputNum` and `VerifyOutputNum` to private scope
 - Append doc for new interface

Signed-off-by: opluss <opluss@qq.com>
onnx/defs/schema.cc Show resolved Hide resolved
onnx/defs/schema.h Outdated Show resolved Hide resolved
@justinchuby justinchuby added the review needed: operators approvers Require reviews from members of operators-approvers label Mar 14, 2024
onnx/defs/schema.cc Outdated Show resolved Hide resolved
@justinchuby justinchuby added this pull request to the merge queue Mar 19, 2024
@justinchuby justinchuby removed the review needed: operators approvers Require reviews from members of operators-approvers label Mar 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 19, 2024
@justinchuby justinchuby added this pull request to the merge queue Mar 19, 2024
Merged via the queue into onnx:main with commit 0bb2775 Mar 19, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Generalize input/output checks from #5990
3 participants