Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unused kernel_size in ResBlock #6999

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions monai/networks/blocks/segresnet_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ def __init__(
self.norm1 = get_norm_layer(name=norm, spatial_dims=spatial_dims, channels=in_channels)
self.norm2 = get_norm_layer(name=norm, spatial_dims=spatial_dims, channels=in_channels)
self.act = get_act_layer(act)
self.conv1 = get_conv_layer(spatial_dims, in_channels=in_channels, out_channels=in_channels)
self.conv2 = get_conv_layer(spatial_dims, in_channels=in_channels, out_channels=in_channels)
self.conv1 = get_conv_layer(
spatial_dims, in_channels=in_channels, out_channels=in_channels, kernel_size=kernel_size
)
self.conv2 = get_conv_layer(
spatial_dims, in_channels=in_channels, out_channels=in_channels, kernel_size=kernel_size
)

def forward(self, x):
identity = x
Expand Down
4 changes: 2 additions & 2 deletions tests/test_segresnet_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
for spatial_dims in range(2, 4):
for in_channels in range(1, 4):
for kernel_size in [1, 3]:
for norm in ["group", "batch", "instance"]:
for norm in [("group", {"num_groups": 1}), "batch", "instance"]:
test_case = [
{
"spatial_dims": spatial_dims,
Expand All @@ -34,7 +34,7 @@
(2, in_channels, *([16] * spatial_dims)),
(2, in_channels, *([16] * spatial_dims)),
]
TEST_CASE_RESBLOCK.append(test_case)
TEST_CASE_RESBLOCK.append(test_case)


class TestResBlock(unittest.TestCase):
Expand Down
Loading