"docs/vscode:/vscode.git/clone" did not exist on "0d23645bd120e6785a3d81ee8e053afe84bbc77f"
Unverified Commit 418d8a6f authored by Local State's avatar Local State Committed by GitHub
Browse files

fix Swin Transformer inplace mutation (#6266)



* fix inplace mutation

* Different attn shouldn't share the same attribute

* a simpler solution
Co-authored-by: default avatarYosuaMichael <yosuamichaelm@gmail.com>
parent 77940b81
......@@ -106,6 +106,7 @@ def shifted_window_attention(
x = F.pad(input, (0, 0, 0, pad_r, 0, pad_b))
_, pad_H, pad_W, _ = x.shape
shift_size = shift_size.copy()
# If window size is larger than feature size, there is no need to shift window
if window_size[0] >= pad_H:
shift_size[0] = 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment