# Codeblock 4 class DenseBlock(nn.Module): def __init__(self, in_channels, repeats): super().__init__() self.bottlenecks = nn.ModuleList() for i in range(repeats): current_in_channels = in_channels + i * GROWTH self.bottlenecks.append(Bottleneck(in_channels=current_in_channels)) def forward(self, x): print(f'original\t\t\t: {x.size()}') for i, bottleneck in enumerate(self.bottlenecks): x = bottleneck(x) print(f'after bottleneck #{i}\t\t: {x.size()}') return x