-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Adding support for exporting models with variable length input/output to ONNX #20034
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
Conversation
cc22369 to
0ff3c48
Compare
test/onnx/test_operators.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean when we use dynamic_axes, we must set input_names and output_names as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly. User does NOT have to to provide input_names/ output_names on export API, if they already know what names are being used in the graph, they shall simply provide such names as keys to dynamic_axes dictionary and NOT specify input_names / output_names . however, if they do not know the names OR intend to use different names on exported model, they also have the option. They can do so by providing those names in input_names / output_names and using them in dynamic_axes.
|
@houseroad gentle reminder in case there are more feedback on this. thanks! |
houseroad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should ask users to specify the input_names/output_names if they use dynamic_axes. Otherwise, they have to guess the name of the inputs/outputs, because they don't have the control of them.
0ff3c48 to
67eeec3
Compare
@houseroad that's a good point. we are already letting user know by generating a warning during _validate_dynamic_axes method. The warning is essentially generated if names are not matching or they are not provided as input/output names. |
7299d67 to
f814e2d
Compare
|
@houseroad gentle reminder ... thanks! |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
houseroad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f814e2d to
05ae9d4
Compare
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@houseroad merged this pull request in 98e3aae. |
Proposal: https://gist.github.com/pk-g/cc45ff8c5891b5699bffd883a87f13ae?fbclid=IwAR17bRA7Fks4APoZRYiNa93UkLdoFCpRDuIYEx0lNVyPTyaDAShbEnytiQo