class_docstr: Uses xformers efficient implementation,
  see https://github.com/MatthieuTPHR/diffusers/blob/d80b531ff8060ec1ea982b65a1b8df70f73aa67c/src/diffusers/models/attention.py#L223
  Note: this is a single-head self-attention operation
class_docstr_tok: ["Uses","xformers","efficient","implementation",",","see","https",":","\/\/github.com\/MatthieuTPHR\/diffusers\/blob\/d80b531ff8060ec1ea982b65a1b8df70f73aa67c\/src\/diffusers\/models\/attention.py","#","L223","Note",":","this","is","a","single-head","self-attention","operation"]
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
      )
      self.attention_op: Optional[Any] = None
  
imports: import logging
  import math
  from typing import Any, Callable, Optional
  import numpy
  import torch
  import torch.nn
  from einops import rearrange
  from packaging import version
  from ...modules.attention import LinearAttention, MemoryEfficientCrossAttention
label_desc: Use image node_id 1 to create a new MemoryEfficientAttnBlock object from inherited base classes: nn with example: obj = MemoryEfficientAttnBlock(in_channels)