code: def sdp_attnblock_forward(self, x):
      h_ = x
      h_ = self.norm(h_)
      q = self.q(h_)
      k = self.k(h_)
      v = self.v(h_)
      b, c, h, w = q.shape
      q, k, v = (
          rearrange(t, "b c h w -> b (h w) c") for t in (q, k, v)
      )
      dtype = q.dtype
      if shared.opts.upcast_attn:
          q, k, v = q.float(), k.float(), v.float()
      q = q.contiguous()
      k = k.contiguous()
      v = v.contiguous()
      out = torch.nn.functional.scaled_dot_product_attention(
          q, k, v, dropout_p=0.0, is_causal=False
      )
      out = out.to(dtype)
      out = rearrange(out, "b (h w) c -> b c h w", h=h)
      out = self.proj_out(out)
      return x + out
  
imports: from __future__ import annotations
  import math
  import psutil
  import platform
  import torch
  from torch import einsum
  from ldm.util import default
  from einops import rearrange
  from modules import shared, errors, devices, sub_quadratic_attention
  from modules.hypernetworks import hypernetwork
  import ldm.modules.attention
  import ldm.modules.diffusionmodules.model
  import sgm.modules.attention
  import sgm.modules.diffusionmodules.model
label_desc: Use image node_id 22 for calling a global function with example usage: sdp_attnblock_forward(x) and returns: unknown