Skip to content

Extend printer to handle non-empty domain#4372

Merged
gramalingam merged 4 commits intoonnx:mainfrom
gramalingam:rama/prtdomain
Aug 2, 2022
Merged

Extend printer to handle non-empty domain#4372
gramalingam merged 4 commits intoonnx:mainfrom
gramalingam:rama/prtdomain

Conversation

@gramalingam
Copy link
Copy Markdown
Contributor

Signed-off-by: Ganesan Ramalingam grama@microsoft.com

Description

The printer does not currently handle a non-empty domain (used for ops in domains other than the standard one).
Extend the printer to handle it.

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
@gramalingam gramalingam requested review from a team as code owners July 22, 2022 20:38
Comment thread onnx/defs/printer.cc
Comment on lines +323 to +324
if (node.domain() != "")
output_ << node.domain() << ".";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"ai.onnx" and "" both mean the default domain. Should ops with domain "ai.onnx" have consistent behavior with those with "" domain?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, that's right. (Does it have any implication to this PR?)

Copy link
Copy Markdown
Member

@daquexian daquexian Jul 25, 2022

Choose a reason for hiding this comment

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

Does it have any implication to this PR?

Yes, maybe the line 323 can be changed to if (node.domain() != "" && node.domain() != "ai.onnx") if we want consistent behavior here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it is better in the current form. Both forms are legal and mean the same thing. The parser/printer are just convenience utilities to convert the proto format to/from a readable textual form. It is useful to preserve the distinction between the two different, but equivalent, forms in the parser/printer.

Copy link
Copy Markdown
Member

@linkerzhang linkerzhang left a comment

Choose a reason for hiding this comment

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

LGTM.

@gramalingam gramalingam enabled auto-merge (squash) August 2, 2022 17:20
@gramalingam gramalingam merged commit 5f3fb1f into onnx:main Aug 2, 2022
broune pushed a commit to broune/onnx that referenced this pull request May 6, 2023
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
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.

4 participants