code: def __init__(
      self,
      in_channels,
      cond_channels,
      downsample_factors=(2, 2, 2),
      out_channels=(128, 256),
  ):
      super(ConditionalDiscriminator, self).__init__()
  
      assert len(downsample_factors) == len(out_channels) + 1
  
      self.in_channels = in_channels
      self.cond_channels = cond_channels
      self.downsample_factors = downsample_factors
      self.out_channels = out_channels
  
      self.pre_cond_layers = nn.ModuleList()
      self.post_cond_layers = nn.ModuleList()
  
      # layers before condition features
      self.pre_cond_layers += [DBlock(in_channels, 64, 1)]
      in_channels = 64
      for i, channel in enumerate(out_channels):
          self.pre_cond_layers.append(
              DBlock(in_channels, channel, downsample_factors[i])
          )
          in_channels = channel
  
      # condition block
      self.cond_block = GBlock(
          in_channels, cond_channels, downsample_factors[-1]
      )
  
      # layers after condition block
      self.post_cond_layers += [
          DBlock(in_channels * 2, in_channels * 2, 1),
          DBlock(in_channels * 2, in_channels * 2, 1),
          nn.AdaptiveAvgPool1d(1),
          nn.Conv1d(in_channels * 2, 1, kernel_size=1),
      ]
  
imports: import numpy
  from torch import nn
label_desc: Use image node_id 1 to create a new ConditionalDiscriminator object from inherited base classes: nn with example: obj = ConditionalDiscriminator(in_channels, cond_channels, downsample_factors, out_channels)