class_docstr: Residual block from SEANet model.
  
  Args:
      dim (int): Dimension of the input/output.
      kernel_sizes (list): List of kernel sizes for the convolutions.
      dilations (list): List of dilations for the convolutions.
      activation (str): Activation function.
      activation_params (dict): Parameters to provide to the activation function.
      norm (str): Normalization method.
      norm_params (dict): Parameters to provide to the underlying normalization used along with the convolution.
      causal (bool): Whether to use fully causal convolution.
      pad_mode (str): Padding mode for the convolutions.
      compress (int): Reduced dimensionality in residual branches (from Demucs v3).
      true_skip (bool): Whether to use true skip connection or a simple
          (streamable) convolution as the skip connection.
class_docstr_tok: ["Residual","block","from","SEANet","model",".","Args",":","dim","(","int",")",":","Dimension","of","the","input\/output",".","kernel_sizes","(","list",")",":","List","of","kernel","sizes","for","the","convolutions",".","dilations","(","list",")",":","List","of","dilations","for","the","convolutions",".","activation","(","str",")",":","Activation","function",".","activation_params","(","dict",")",":","Parameters","to","provide","to","the","activation","function",".","norm","(","str",")",":","Normalization","method",".","norm_params","(","dict",")",":","Parameters","to","provide","to","the","underlying","normalization","used","along","with","the","convolution",".","causal","(","bool",")",":","Whether","to","use","fully","causal","convolution",".","pad_mode","(","str",")",":","Padding","mode","for","the","convolutions",".","compress","(","int",")",":","Reduced","dimensionality","in","residual","branches","(","from","Demucs","v3",")",".","true_skip","(","bool",")",":","Whether","to","use","true","skip","connection","or","a","simple","(","streamable",")","convolution","as","the","skip","connection","."]
code: def __init__(
      self,
      dim: int,
      kernel_sizes: tp.List[int] = [3, 1],
      dilations: tp.List[int] = [1, 1],
      activation: str = "ELU",
      activation_params: dict = {"alpha": 1.0},
      norm: str = "none",
      norm_params: tp.Dict[str, tp.Any] = {},
      causal: bool = False,
      pad_mode: str = "reflect",
      compress: int = 2,
      true_skip: bool = True,
  ):
      super().__init__()
      assert len(kernel_sizes) == len(
          dilations
      ), "Number of kernel sizes should match number of dilations"
      act = getattr(nn, activation)
      hidden = dim // compress
      block = []
      for i, (kernel_size, dilation) in enumerate(
          zip(kernel_sizes, dilations)
      ):
          in_chs = dim if i == 0 else hidden
          out_chs = dim if i == len(kernel_sizes) - 1 else hidden
          block += [
              act(**activation_params),
              StreamableConv1d(
                  in_chs,
                  out_chs,
                  kernel_size=kernel_size,
                  dilation=dilation,
                  norm=norm,
                  norm_kwargs=norm_params,
                  causal=causal,
                  pad_mode=pad_mode,
              ),
          ]
      self.block = nn.Sequential(*block)
      self.shortcut: nn.Module
      if true_skip:
          self.shortcut = nn.Identity()
      else:
          self.shortcut = StreamableConv1d(
              dim,
              dim,
              kernel_size=1,
              norm=norm,
              norm_kwargs=norm_params,
              causal=causal,
              pad_mode=pad_mode,
          )
  
file_path: audiocraft/audiocraft/modules/seanet.py
imports: import typing
  import numpy
  import torch.nn
  from .conv import StreamableConv1d, StreamableConvTranspose1d
  from .lstm import StreamableLSTM
label_desc: Use image node_id 1 to create a new SEANetResnetBlock object from inherited base classes: nn with example: obj = SEANetResnetBlock(dim, kernel_sizes, dilations, activation, activation_params, norm, norm_params, causal, pad_mode, compress, true_skip)