Skip to content

Commit 1c00ea2

Browse files
bug: Fix PatchMerging duplicate merging (#8285)
Fixes # . ### Description A few sentences describing the changes proposed in this pull request. ### Types of changes - [x] Non-breaking change (fix or new feature that would not break existing functionality). Fixing issue #8284 In this format there are no duplicates: ``` t = [ (0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 0, 1), (1, 1, 0), (0, 1, 1), (1, 1, 1), ] print(set(t)) # {(1, 0, 1), (1, 1, 0), (0, 1, 0), (0, 0, 0), (1, 0, 0), (0, 0, 1), (1, 1, 1), (0, 1, 1)} ``` --------- Signed-off-by: pooya-mohammadi <[email protected]>
1 parent 9eb0a8c commit 1c00ea2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

monai/networks/nets/swin_unetr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,9 @@ def forward(self, x):
782782
x1 = x[:, 1::2, 0::2, 0::2, :]
783783
x2 = x[:, 0::2, 1::2, 0::2, :]
784784
x3 = x[:, 0::2, 0::2, 1::2, :]
785-
x4 = x[:, 1::2, 0::2, 1::2, :]
786-
x5 = x[:, 0::2, 1::2, 0::2, :]
787-
x6 = x[:, 0::2, 0::2, 1::2, :]
785+
x4 = x[:, 1::2, 1::2, 0::2, :]
786+
x5 = x[:, 1::2, 0::2, 1::2, :]
787+
x6 = x[:, 0::2, 1::2, 1::2, :]
788788
x7 = x[:, 1::2, 1::2, 1::2, :]
789789
x = torch.cat([x0, x1, x2, x3, x4, x5, x6, x7], -1)
790790
x = self.norm(x)

0 commit comments

Comments
 (0)