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

x_mask and source_mask is None #32

Closed
spacycoder opened this issue Aug 9, 2024 · 2 comments
Closed

x_mask and source_mask is None #32

spacycoder opened this issue Aug 9, 2024 · 2 comments

Comments

@spacycoder
Copy link

spacycoder commented Aug 9, 2024

Hi, great work!

Quick question, why do you assert that x_mask and source_mask should be None here:

assert x_mask is None and source_mask is None

Shouldn't the masks be applied to the qkv tensors? The rest of the code seems to allow for x_mask and source_mask to be available

@wyf2020
Copy link
Contributor

wyf2020 commented Aug 9, 2024

Thank you for your question! Currently, our code only support padding mask and will crop image by padding mask before transformer. If you want to use mask of generalized shape, you can pass the mask into here and modify the parameter of F.scaled_dot_product_attention or add a manually mask like LoFTR. We will provide config choice for this operation soon. For more detailed explanation, you can also have a look at this issue.

@spacycoder
Copy link
Author

OK, thanks!

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

No branches or pull requests

2 participants