code: def __init__(self, c, c_cond, nhead, self_attn=True, dropout=0.0):
      super().__init__()
  
      linear_cls = (
          nn.Linear if USE_PEFT_BACKEND else LoRACompatibleLinear
      )
  
      self.self_attn = self_attn
      self.norm = WuerstchenLayerNorm(
          c, elementwise_affine=False, eps=1e-6
      )
      self.attention = Attention(
          query_dim=c,
          heads=nhead,
          dim_head=c // nhead,
          dropout=dropout,
          bias=True,
      )
      self.kv_mapper = nn.Sequential(nn.SiLU(), linear_cls(c_cond, c))
  
imports: import torch
  import torch.nn
  from ...models.attention_processor import Attention
  from ...models.lora import LoRACompatibleConv, LoRACompatibleLinear
  from ...utils import USE_PEFT_BACKEND
label_desc: Use image node_id 1 to create a new AttnBlock object from inherited base classes: nn with example: obj = AttnBlock(c, c_cond, nhead, _attn, dropout)