docstr: Returns:
      `dict` of attention processors: A dictionary containing all attention processors used in the model with
      indexed by its weight name.
code: def attn_processors(self) -> Dict[str, AttentionProcessor]:
      r"""
      Returns:
          `dict` of attention processors: A dictionary containing all attention processors used in the model with
          indexed by its weight name.
      """
      # set recursively
      processors = {}
  
      def fn_recursive_add_processors(
          name: str,
          module: torch.nn.Module,
          processors: Dict[str, AttentionProcessor],
      ):
          if hasattr(module, "get_processor"):
              processors[f"{name}.processor"] = module.get_processor(
                  return_deprecated_lora=True
              )
  
          for sub_name, child in module.named_children():
              fn_recursive_add_processors(
                  f"{name}.{sub_name}", child, processors
              )
  
          return processors
  
      for name, module in self.named_children():
          fn_recursive_add_processors(name, module, processors)
  
      return processors
  
imports: from typing import Dict, Union
  import torch
  import torch.nn.functional
  from torch import nn
  from torch.utils.checkpoint import checkpoint
  from ..configuration_utils import ConfigMixin, register_to_config
  from ..loaders import PeftAdapterMixin
  from .attention import BasicTransformerBlock, SkipFFTransformerBlock
  from .attention_processor import ADDED_KV_ATTENTION_PROCESSORS, CROSS_ATTENTION_PROCESSORS, AttentionProcessor, AttnAddedKVProcessor, AttnProcessor
  from .embeddings import TimestepEmbedding, get_timestep_embedding
  from .modeling_utils import ModelMixin
  from .normalization import GlobalResponseNorm, RMSNorm
  from .resnet import Downsample2D, Upsample2D
label_desc: Use image node_id 4 for calling the UVit2DModel obj's underlying member method code with example usage: obj.attn_processors() and returns: processors, processors