We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
# flat_q, flat_k, flat_v # (batch_size, Nh, height * width, dvh or dkh) flat_q = torch.reshape(q, (N, Nh, dk // Nh, H * W)) flat_k = torch.reshape(k, (N, Nh, dk // Nh, H * W)) flat_v = torch.reshape(v, (N, Nh, dv // Nh, H * W))
The text was updated successfully, but these errors were encountered:
# attn_out # (batch, Nh, height * width, dvh) attn_out = torch.matmul(weights, flat_v.transpose(2, 3)) # shape: (batch, Nh, height * width, dvh) attn_out = torch.reshape(attn_out, (batch, self.Nh, self.dv // self.Nh, height, width))
I have similar questions about this part as well. Doesn't reshaping like this messes up the order of values?
Really hope to get some clarification on this. Many thanks.
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: