class_docstr: SBD (Sub-band Discriminator) Block
class_docstr_tok: ["SBD","(","Sub-band","Discriminator",")","Block"]
code: def __init__(
      self,
      segment_dim,
      strides,
      filters,
      kernel_size,
      dilations,
      use_spectral_norm=False,
  ):
      super(SBDBlock, self).__init__()
      norm_f = weight_norm if not use_spectral_norm else spectral_norm
      self.convs = torch.nn.ModuleList()
      filters_in_out = [(segment_dim, filters[0])]
      for i in range(len(filters) - 1):
          filters_in_out.append([filters[i], filters[i + 1]])
      for _s, _f, _k, _d in zip(
          strides, filters_in_out, kernel_size, dilations
      ):
          self.convs.append(
              MDC(
                  in_channels=_f[0],
                  out_channels=_f[1],
                  strides=_s,
                  kernel_size=_k,
                  dilations=_d,
                  use_spectral_norm=use_spectral_norm,
              )
          )
      self.post_conv = norm_f(
          Conv1d(
              in_channels=_f[1],
              out_channels=1,
              kernel_size=3,
              stride=1,
              padding=3 // 2,
          )
      )
  
imports: import logging
  from typing import Any, Dict, List, Optional
  import torch
  import torch.nn.functional
  from torch.nn import Conv1d
  from torch.nn.utils import spectral_norm, weight_norm
  from espnet2.gan_svs.visinger2.visinger2_vocoder import MultiFrequencyDiscriminator
  from espnet2.gan_tts.hifigan.residual_block import ResidualBlock
  from espnet2.gan_tts.melgan.pqmf import PQMF
label_desc: Use image node_id 1 to create a new SBDBlock object from inherited base classes: torch.nn with example: obj = SBDBlock(segment_dim, strides, filters, kernel_size, dilations, use_spectral_norm)