class_docstr: An attention block that allows spatial positions to attend to each other.
  Originally ported from here, but adapted to the N-d case.
  https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/models/unet.py#L66.
class_docstr_tok: ["An","attention","block","that","allows","spatial","positions","to","attend","to","each","other",".","Originally","ported","from","here",",","but","adapted","to","the","N-d","case",".","https",":","\/\/github.com\/hojonathanho\/diffusion\/blob\/1e0dceb3b3495bbe19116a5e1b3596cd0706c543\/diffusion_tf\/models\/unet.py","#","L66","."]
code: def forward(self, x):
      return checkpoint(self._forward, (x,), self.parameters(), True)
  
imports: import math
  from abc import abstractmethod
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from ldm.modules.attention import SpatialTransformer
  from ldm.modules.diffusionmodules.util import avg_pool_nd, checkpoint, conv_nd, linear, normalization, timestep_embedding, zero_module
  from ldm.util import exists
label_desc: Use image node_id 2 for calling the AttentionBlock obj's underlying member method code with example usage: obj.forward(x) and returns: checkpoint