Revert "much stricter ruff linting"

This reverts commit 310dbf1574.
This commit is contained in:
Vladimir Mandic
2026-05-11 08:13:57 +02:00
parent 8296d07ff8
commit c8d6fd5cf8
132 changed files with 363 additions and 292 deletions
+2 -2
View File
@@ -238,7 +238,7 @@ class SwinTransformerBlock(nn.Module):
def forward(self, x, x_size):
H, W = x_size
B, _L, C = x.shape
B, L, C = x.shape
# assert L == H * W, "input feature has wrong size"
shortcut = x
@@ -559,7 +559,7 @@ class PatchUnEmbed(nn.Module):
self.embed_dim = embed_dim
def forward(self, x, x_size):
B, _HW, _C = x.shape
B, HW, C = x.shape
x = x.transpose(1, 2).view(B, self.embed_dim, x_size[0], x_size[1]) # B Ph*Pw C
return x
+3 -3
View File
@@ -266,7 +266,7 @@ class SwinTransformerBlock(nn.Module):
def forward(self, x, x_size):
H, W = x_size
B, _L, C = x.shape
B, L, C = x.shape
#assert L == H * W, "input feature has wrong size"
shortcut = x
@@ -476,7 +476,7 @@ class PatchEmbed(nn.Module):
self.norm = None
def forward(self, x):
_B, _C, _H, _W = x.shape
B, C, H, W = x.shape
# FIXME look at relaxing size constraints
# assert H == self.img_size[0] and W == self.img_size[1],
# f"Input image size ({H}*{W}) doesn't match model ({self.img_size[0]}*{self.img_size[1]})."
@@ -591,7 +591,7 @@ class PatchUnEmbed(nn.Module):
self.embed_dim = embed_dim
def forward(self, x, x_size):
B, _HW, _C = x.shape
B, HW, C = x.shape
x = x.transpose(1, 2).view(B, self.embed_dim, x_size[0], x_size[1]) # B Ph*Pw C
return x