-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[ONNX] Squeeze operator should give an error when trying to apply to a dimension with shape > 1 #38476
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
💊 CI failures summary and remediationsAs of commit a0d1116 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 78 times. |
|
You can catch flake8 issues locally using command: flake8 . |
|
@neginraoof when this is ready to land ping and I can land it |
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.
Could you rebase to master and make sure all related tests passing?
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.
Please make sure all the ci passing:
- Lint / flake8-py3 (pull_request)
- onnx
neginraoof
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.
Thanks! I added a few comments.
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.
neginraoof
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. Thanks!
|
@yaeldekel |
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.
Could you reabse to the master and rerun the CI?
torch/onnx/utils.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.
Can we add attributes within the addNode c++ method?
torch/onnx/symbolic_opset11.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.
Can we directly check the self's size instead of inserting IF-else block?
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.
The size is not always available at export time, so we needed to add an if-else block.
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.
Please resolve the conflict.
|
We still have conflict, could you rebase the PR to master? @yaeldekel |
|
Could you please resolve the conflicts? |
… outputs in opset 9
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 3c5e396. |
|
@yaeldekel Could you please explain the new behavior? Does it now emulate PyTorch behavior in ONNX? Does it now prohibit the squeeze(dim) on non-singleton dim from PyTorch? |
|
So...what's the outcome of this issue? |
The ONNX spec for the Squeeze operator:
Currently, as explained in issue #36796, it is possible to export such a model to ONNX, and this results in an exception from ONNX runtime.
Fixes #36796.