code: def __init__(self, in_channels):
      super().__init__()
      self.in_channels = in_channels
  
      self.norm = normalize(in_channels)
      self.q = torch.nn.Conv2d(
          in_channels, in_channels, kernel_size=1, stride=1, padding=0
      )
      self.k = torch.nn.Conv2d(
          in_channels, in_channels, kernel_size=1, stride=1, padding=0
      )
      self.v = torch.nn.Conv2d(
          in_channels, in_channels, kernel_size=1, stride=1, padding=0
      )
      self.proj_out = torch.nn.Conv2d(
          in_channels, in_channels, kernel_size=1, stride=1, padding=0
      )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from basicsr.utils import get_root_logger
  from basicsr.utils.registry import ARCH_REGISTRY
label_desc: Use image node_id 1 to create a new AttnBlock object from inherited base classes: nn with example: obj = AttnBlock(in_channels)