-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Is there some errors in transformers mha.py #216
Comments
After reading the entire code, I think I understand the second problem. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in the file labml_nn/transformer/mha.py
I have question about:
The first:
I think Output should be
[seq_len, batch_size, heads, d_k]
or[batch_size, heads, d_k]
The second:
I think the code
dim
should be -1Output should be
[seq_len, batch_size, heads, d_k]
and after dot-product with keys, the result should be[seq_len, batch_size, heads, seq_len]
, and the key dimension should be the last one, so I thinkdim
should be -1.I also have troubles of the case of output is
[batch_size, heads, d_k]
, I have no idea what the result is after dot-product,and what dim should be
The text was updated successfully, but these errors were encountered: