class_docstr: A module which performs QKV attention and splits in a different order.
  
  Example
  -------
  >>> attn = QKVAttention(4)
  >>> n = 4
  >>> c = 8
  >>> h = 64
  >>> w = 16
  >>> qkv = torch.randn(4, (3 * h * c), w)
  >>> out = attn(qkv)
  >>> out.shape
  torch.Size([4, 512, 16])
class_docstr_tok: ["A","module","which","performs","QKV","attention","and","splits","in","a","different","order",".","Example","--","--","--","-",">",">",">","attn","=","QKVAttention","(","4",")",">",">",">","n","=","4",">",">",">","c","=","8",">",">",">","h","=","64",">",">",">","w","=","16",">",">",">","qkv","=","torch.randn","(","4",",","(","3","*","h","*","c",")",",","w",")",">",">",">","out","=","attn","(","qkv",")",">",">",">","out.shape","torch.Size","(","[","4",",","512",",","16","]",")"]
code: def __init__(self, n_heads):
      super().__init__()
      self.n_heads = n_heads
  
imports: from abc import abstractmethod
  from speechbrain.utils.data_utils import pad_divisible
  from .autoencoders import NormalizingAutoencoder
  import math
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new QKVAttention object from inherited base classes: nn with example: obj = QKVAttention(n_heads)