Skip to content
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: 4 additions & 4 deletions monai/networks/blocks/aspp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Sequence
from typing import Optional, Sequence, Tuple, Union

import torch
import torch.nn as nn

from monai.networks.blocks.convolutions import Convolution
from monai.networks.layers import same_padding
from monai.networks.layers.factories import Act, Conv, Norm
from monai.networks.layers.factories import Conv


class SimpleASPP(nn.Module):
Expand All @@ -37,8 +37,8 @@ def __init__(
conv_out_channels: int,
kernel_sizes: Sequence[int] = (1, 3, 3, 3),
dilations: Sequence[int] = (1, 2, 4, 6),
norm_type=Norm.BATCH,
acti_type=Act.LEAKYRELU,
norm_type: Optional[Union[Tuple, str]] = "BATCH",
acti_type: Optional[Union[Tuple, str]] = "LEAKYRELU",
Comment on lines +40 to +41

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's wrong with leaving the right sight of the equals as they were? E.g., Norm.BATCH and Act.LEAKYRELU?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks!

) -> None:
"""
Args:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_simple_aspp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

TEST_CASES = [
[ # 32-channel 2D, batch 7
{"spatial_dims": 2, "in_channels": 32, "conv_out_channels": 3},
{"spatial_dims": 2, "in_channels": 32, "conv_out_channels": 3, "norm_type": ("batch", {"affine": False})},
(7, 32, 18, 20),
(7, 12, 18, 20),
],
[ # 4-channel 1D, batch 16
{"spatial_dims": 1, "in_channels": 4, "conv_out_channels": 8},
{"spatial_dims": 1, "in_channels": 4, "conv_out_channels": 8, "acti_type": ("PRELU", {"num_parameters": 32})},
(16, 4, 17),
(16, 32, 17),
],
Expand Down