class_docstr: Residual 1D block with temporal convolutions.
  
  Parameters:
      inp_channels (`int`): Number of input channels.
      out_channels (`int`): Number of output channels.
      embed_dim (`int`): Embedding dimension.
      kernel_size (`int` or `tuple`): Size of the convolving kernel.
class_docstr_tok: ["Residual","1D","block","with","temporal","convolutions",".","Parameters",":","inp_channels","(","`","int","`",")",":","Number","of","input","channels",".","out_channels","(","`","int","`",")",":","Number","of","output","channels",".","embed_dim","(","`","int","`",")",":","Embedding","dimension",".","kernel_size","(","`","int","`","or","`","tuple","`",")",":","Size","of","the","convolving","kernel","."]
code: def __init__(
      self,
      inp_channels: int,
      out_channels: int,
      embed_dim: int,
      kernel_size: Union[int, Tuple[int, int]] = 5,
  ):
      super().__init__()
      self.conv_in = Conv1dBlock(
          inp_channels, out_channels, kernel_size
      )
      self.conv_out = Conv1dBlock(
          out_channels, out_channels, kernel_size
      )
  
      self.time_emb_act = nn.Mish()
      self.time_emb = nn.Linear(embed_dim, out_channels)
  
      self.residual_conv = (
          nn.Conv1d(inp_channels, out_channels, 1)
          if inp_channels != out_channels
          else nn.Identity()
      )
  
imports: from functools import partial
  from typing import Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from ..utils import USE_PEFT_BACKEND
  from .activations import get_activation
  from .attention import AdaGroupNorm
  from .attention_processor import SpatialNorm
  from .lora import LoRACompatibleConv, LoRACompatibleLinear
label_desc: Use image node_id 1 to create a new ResidualTemporalBlock1D object from inherited base classes: nn with example: obj = ResidualTemporalBlock1D(inp_channels, out_channels, embed_dim, kernel_size)