class A(nn.Module):
  def __init__(self):
    super().__init__()
    self.conv = nn.Conv2d(in_channels=256, out_channels=32, 
                      kernel_size=9, stride=2, padding=0)
  def forward(self, x):
    return self.conv(x)

class B(nn.Module):
  def __init__(self):
    super().__init__()
    self.capsules = nn.ModuleList([
            nn.Conv2d(in_channels=256, out_channels=32, 
                      kernel_size=9, stride=2, padding=0)
            for _ in range(8)])    
  def forward(self, x):
    ...

class C(nn.Module):
  def __init__(self):
    super().__init__()
    self.capsules = nn.ModuleList([A() for _ in range(8)])    
  def forward(self, x):
     ...