class_docstr: A self-attention block, based on: "Dosovitskiy et al.,
  An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale <https://arxiv.org/abs/2010.11929>"
code: def forward(self, x):
      output = self.input_rearrange(self.qkv(x))
      q, k, v = output[0], output[1], output[2]
      att_mat = (
          torch.einsum("blxd,blyd->blxy", q, k) * self.scale
      ).softmax(dim=-1)
      if self.save_attn:
          # no gradients and new tensor;
          # https://pytorch.org/docs/stable/generated/torch.Tensor.detach.html
          self.att_mat = att_mat.detach()
  
      att_mat = self.drop_weights(att_mat)
      x = torch.einsum("bhxy,bhyd->bhxd", att_mat, v)
      x = self.out_rearrange(x)
      x = self.out_proj(x)
      x = self.drop_output(x)
      return x
  
file_path: MONAI/monai/networks/blocks/selfattention.py
imports: from __future__ import annotations
  import torch
  import torch.nn
  from monai.utils import optional_import
label_desc: Use image node_id 2 for calling the SABlock obj's underlying member method code with example usage: obj.forward(x) and returns: x