code: def __init__(
      self,
      in_channels: int,
      out_channels: Optional[int] = None,
      conv_shortcut: bool = False,
      dropout: float = 0.0,
      norm_type: str = "group",
  ):
      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.use_conv_shortcut = conv_shortcut
  
      self.norm1 = create_norm(in_channels, norm_type)
      self.conv1 = torch.nn.Conv2d(
          in_channels, out_channels, kernel_size=3, stride=1, padding=1
      )
      self.norm2 = create_norm(out_channels, norm_type)
      self.dropout = torch.nn.Dropout(dropout)
      self.conv2 = torch.nn.Conv2d(
          out_channels, out_channels, kernel_size=3, stride=1, padding=1
      )
      if self.in_channels != self.out_channels:
          if self.use_conv_shortcut:
              self.conv_shortcut = torch.nn.Conv2d(
                  in_channels,
                  out_channels,
                  kernel_size=3,
                  stride=1,
                  padding=1,
              )
          else:
              self.nin_shortcut = torch.nn.Conv2d(
                  in_channels,
                  out_channels,
                  kernel_size=1,
                  stride=1,
                  padding=0,
              )
  
imports: import logging
  from typing import Optional, Sequence
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from neuralcompression.layers import XCA, ChannelNorm2D
  from .._outputs._vqvae_autoencoder_output import VqVaeAutoencoderOutput
label_desc: Use image node_id 1 to create a new _ResnetBlock object from inherited base classes: nn with example: obj = _ResnetBlock(in_channels, out_channels, conv_shortcut, dropout, norm_type)