class_docstr: ## Multi-head attention with rotary positional embeddings
  
  We override [multi-head attention from original transformer](../mha.html).
class_docstr_tok: ["#","#","Multi-head","attention","with","rotary","positional","embeddings","We","override","[","multi-head","attention","from","original","transformer","]","(","..","\/mha.html",")","."]
docstr: ### Calculate scores between queries and keys
docstr_tok: ["#","#","#","Calculate","scores","between","queries","and","keys"]
code: def get_scores(self, query: torch.Tensor, key: torch.Tensor):
      """
      ### Calculate scores between queries and keys
      """
  
      # Calculate dot-product with RoPE
      return torch.einsum(
          "ibhd,jbhd->ijbh",
          self.query_rotary_pe(query),
          self.key_rotary_pe(key),
      )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/transformers/rope/__init__.py
imports: import torch
  from torch import nn
  from labml.logger import inspect
  from labml_nn.transformers.mha import MultiHeadAttention
label_desc: Use image node_id 2 for calling the RotaryPEMultiHeadAttention obj's underlying member method code with example usage: obj.get_scores(query, key) and returns: torch