code: def original(q, k, v, mask, heads, dim_head):
      """Attention Implementation backing AttentionImplementations.ORIGINAL
  
      - Not recommended for ANE
      - Recommended for GPU
      """
      bs = q.size(0)
      mh_q = q.view(bs, heads, dim_head, -1)
      mh_k = k.view(bs, heads, dim_head, -1)
      mh_v = v.view(bs, heads, dim_head, -1)
  
      attn_weights = torch.einsum("bhcq,bhck->bhqk", [mh_q, mh_k])
      attn_weights.mul_(dim_head**-0.5)
  
      if mask is not None:
          attn_weights = attn_weights + mask
  
      attn_weights = attn_weights.softmax(dim=3)
  
      attn = torch.einsum("bhqk,bhck->bhcq", [attn_weights, mh_v])
      attn = attn.contiguous().view(bs, heads * dim_head, 1, -1)
      return attn
  
imports: import logging
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: original(q, k, v, mask, heads, dim_head) and returns: attn