From 94195a90fbefe3d07267cfb85504bb733cd82b39 Mon Sep 17 00:00:00 2001 From: pooya-mohammadi Date: Tue, 7 Jan 2025 17:45:56 +0100 Subject: [PATCH 1/2] bug: Fix PatchMerging duplicate merging --- monai/networks/nets/swin_unetr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monai/networks/nets/swin_unetr.py b/monai/networks/nets/swin_unetr.py index 77f0d2ec2f..d7747a695c 100644 --- a/monai/networks/nets/swin_unetr.py +++ b/monai/networks/nets/swin_unetr.py @@ -783,8 +783,8 @@ def forward(self, x): x2 = x[:, 0::2, 1::2, 0::2, :] x3 = x[:, 0::2, 0::2, 1::2, :] x4 = x[:, 1::2, 0::2, 1::2, :] - x5 = x[:, 0::2, 1::2, 0::2, :] - x6 = x[:, 0::2, 0::2, 1::2, :] + x5 = x[:, 1::2, 1::2, 0::2, :] + x6 = x[:, 0::2, 1::2, 1::2, :] x7 = x[:, 1::2, 1::2, 1::2, :] x = torch.cat([x0, x1, x2, x3, x4, x5, x6, x7], -1) x = self.norm(x) From b091cc8bda6bb24b98fb2352e0a8e5aac5bec8fa Mon Sep 17 00:00:00 2001 From: pooya-mohammadi Date: Thu, 9 Jan 2025 09:36:11 +0100 Subject: [PATCH 2/2] DCO Remediation Commit for pooya-mohammadi I, pooya-mohammadi , hereby add my Signed-off-by to this commit: 94195a90fbefe3d07267cfb85504bb733cd82b39 Signed-off-by: pooya-mohammadi --- monai/networks/nets/swin_unetr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monai/networks/nets/swin_unetr.py b/monai/networks/nets/swin_unetr.py index d7747a695c..cfc5dda41f 100644 --- a/monai/networks/nets/swin_unetr.py +++ b/monai/networks/nets/swin_unetr.py @@ -782,8 +782,8 @@ def forward(self, x): x1 = x[:, 1::2, 0::2, 0::2, :] x2 = x[:, 0::2, 1::2, 0::2, :] x3 = x[:, 0::2, 0::2, 1::2, :] - x4 = x[:, 1::2, 0::2, 1::2, :] - x5 = x[:, 1::2, 1::2, 0::2, :] + x4 = x[:, 1::2, 1::2, 0::2, :] + x5 = x[:, 1::2, 0::2, 1::2, :] x6 = x[:, 0::2, 1::2, 1::2, :] x7 = x[:, 1::2, 1::2, 1::2, :] x = torch.cat([x0, x1, x2, x3, x4, x5, x6, x7], -1)