Return a normalization layer.
(norm_type: str, *args, **kwargs)
| 8 | |
| 9 | |
| 10 | def norm_layer(norm_type: str, *args, **kwargs) -> nn.Module: |
| 11 | """ |
| 12 | Return a normalization layer. |
| 13 | """ |
| 14 | if norm_type == "group": |
| 15 | return GroupNorm32(32, *args, **kwargs) |
| 16 | elif norm_type == "layer": |
| 17 | return ChannelLayerNorm32(*args, **kwargs) |
| 18 | else: |
| 19 | raise ValueError(f"Invalid norm type {norm_type}") |
| 20 | |
| 21 | |
| 22 | class ResBlock3d(nn.Module): |
no test coverage detected