code: def __init__(
      self,
      in_channels: int,
      out_channels: Optional[int] = None,
      dropout: float = 0.0,
  ):
      super().__init__()
      self.in_channels = in_channels
      out_channels = (
          in_channels if out_channels is None else out_channels
      )
      self.out_channels = out_channels
      self.net = nn.Sequential(
          normalize(in_channels),
          nn.SiLU(),
          Conv2d(in_channels, out_channels, kernel_size=3, padding=1),
          normalize(out_channels),
          nn.SiLU(),
          nn.Dropout(dropout),
          Conv2d(out_channels, out_channels, kernel_size=3, padding=1),
      )
      if in_channels == out_channels:
          self.shortcut = None
      else:
          self.shortcut = Conv2d(
              in_channels, out_channels, kernel_size=1, padding=0
          )
  
imports: import torch
  import torch.nn
  from torch import Tensor
  from typing import List
  from typing import Optional
  from .schema import EncoderMixin
  from ....modules.blocks import Conv2d
label_desc: Use image node_id 1 to create a new ResidualBlock object from inherited base classes: nn with example: obj = ResidualBlock(in_channels, out_channels, dropout)