Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
Support forUnflatten operation requred byAttention layer#25851
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| if (range.start <0) | ||
| { | ||
| range.start += n; | ||
| if (!(range.start == n)){ |
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.
if (range.start != n)
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.
Ifrange.start == n doe it mean uninitialized value?
AbdurrahheemJul 3, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
no, it means thatstart index is equal to the last dimention of the input, in which case we do not want it to be(n-1)
asmorkalov commentedJul 3, 2024
@Abdurrahheem Should it be back-ported to 4.x too? |
asmorkalov commentedJul 4, 2024
Replaced by#25861 |
Pull Request Readiness Checklist
All test data and models for PR are located#1188
This PR fixes issue reised when importing batched vanilla
Attentionlayer fromPyTorchvia ONNX. Currently batched version ofAttentionlayer in PyTorchhas unflatten operation inside.unflattenoperation causes issue inreshapelayer (see the Reshape_2 in the graph below) due to incorrect output ofslicelayer. This PR particularly fixessliceandconcatlayers to handleunflattenoperation.See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.