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
Hi,
the relative_position_bias seems to be a constant index of self.relative_position_bias_table, why should it be computed in forward() every time?
relative_position_bias
self.relative_position_bias_table
For the code, why the following code can't be computed in WindowAttention.__init__()?
WindowAttention.__init__()
relative_position_bias = self.relative_position_bias_table[self.relative_position_index.view(-1)].view( self.window_size[0] * self.window_size[1], self.window_size[0] * self.window_size[1], -1) # Wh*Ww,Wh*Ww,nH relative_position_bias = relative_position_bias.permute(2, 0, 1).contiguous() # nH, Wh*Ww, Wh*Ww
Thank you for your time to solve my confusion~
The text was updated successfully, but these errors were encountered:
I have the same question. relative_position_bias are selected by indexes from a predefined tensor, also it's shape won't change during training
Sorry, something went wrong.
No branches or pull requests
Hi,
the
relative_position_bias
seems to be a constant index ofself.relative_position_bias_table
, why should it be computed in forward() every time?For the code, why the following code can't be computed in
WindowAttention.__init__()
?Thank you for your time to solve my confusion~
The text was updated successfully, but these errors were encountered: