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

softmax sliently generate a wrong output when the mask has an incompatible shape #19722

Open
AGFACBNNR opened this issue May 17, 2024 · 1 comment · May be fixed by #19736
Open

softmax sliently generate a wrong output when the mask has an incompatible shape #19722

AGFACBNNR opened this issue May 17, 2024 · 1 comment · May be fixed by #19736

Comments

@AGFACBNNR
Copy link

As shown in this colab, the mask can arbitrarily change the shape of output.
Although the document requires that the mask has the same shape with input, no check exists actually.
In my project, the shape of input is hard to compute and this potential incompatibility can affect the result and is hard to debug since softmax now silently generates an wrong output.
Currently the output is:
1715915144162
You can identify the shape changed by mask(line 2 and line 3 of output), which is different from the correct shape computed by compute_output_shape() (line4).

@SuryanarayanaY
Copy link
Collaborator

Hi @AGFACBNNR ,

Thanks for reporting this issue. I acknowledge the missing check for same shape for input and mask. Attached gist for same.

Will propose a fix for same. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants