Skip to content

Commit 3119589

Browse files
gihwan-kimplyfagerZ-Fran
authored
[Feature] Add groups parameter to Conv2d in ResidualBlockNoBN (#1510)
* [Enhancement] In ResidualBlockNoBN add groups parameter to Conv2d * Update mmedit/models/common/sr_backbone_utils.py * Update mmedit/models/common/sr_backbone_utils.py * fix lint --------- Co-authored-by: Yifei Yang <[email protected]> Co-authored-by: Z-Fran <[email protected]>
1 parent 8f90ccc commit 3119589

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mmedit/models/common/sr_backbone_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ class ResidualBlockNoBN(nn.Module):
5656
Default: 1.0.
5757
"""
5858

59-
def __init__(self, mid_channels=64, res_scale=1.0):
59+
def __init__(self, mid_channels=64, res_scale=1.0, groups=1):
6060
super().__init__()
6161
self.res_scale = res_scale
62-
self.conv1 = nn.Conv2d(mid_channels, mid_channels, 3, 1, 1, bias=True)
63-
self.conv2 = nn.Conv2d(mid_channels, mid_channels, 3, 1, 1, bias=True)
62+
self.conv1 = nn.Conv2d(
63+
mid_channels, mid_channels, 3, 1, 1, bias=True, groups=groups)
64+
self.conv2 = nn.Conv2d(
65+
mid_channels, mid_channels, 3, 1, 1, bias=True, groups=groups)
6466

6567
self.relu = nn.ReLU(inplace=True)
6668

0 commit comments

Comments
 (0)