code: def quat_e_interaction(
      h: torch.FloatTensor,
      r: torch.FloatTensor,
      t: torch.FloatTensor,
      table: torch.FloatTensor,
  ):
      """Evaluate the interaction function of QuatE for given embeddings.
  
      The embeddings have to be in a broadcastable shape.
  
      :param h: shape: (`*batch_dims`, dim, 4)
          The head representations.
      :param r: shape: (`*batch_dims`, dim, 4)
          The head representations.
      :param t: shape: (`*batch_dims`, dim, 4)
          The tail representations.
      :param table:
          the quaternion multiplication table.
  
      :return: shape: (...)
          The scores.
      """
      # TODO: this sign is in the official code, too, but why do we need it?
      return -einsum("...di, ...dj, ...dk, ijk -> ...", h, r, t, table)
  
imports: from __future__ import annotations
  import functools
  from typing import Optional, Tuple, Union
  import numpy
  import torch
  from torch import broadcast_tensors, nn
  from .compute_kernel import batched_dot
  from .sim import KG2E_SIMILARITIES
  from ..typing import GaussianDistribution
  from ..utils import clamp_norm, einsum, is_cudnn_error, make_ones_like, negative_norm, negative_norm_of_sum, project_entity, tensor_product, tensor_sum
label_desc: Use image node_id 27 for calling a global function with example usage: quat_e_interaction(h, r, t, table) and returns: unknown