code: def transr_interaction(
      h: torch.FloatTensor,
      r: torch.FloatTensor,
      t: torch.FloatTensor,
      m_r: torch.FloatTensor,
      p: int,
      power_norm: bool = True,
  ) -> torch.FloatTensor:
      """Evaluate the TransR interaction function.
  
      :param h: shape: (`*batch_dims`, d_e)
          Head embeddings.
      :param r: shape: (`*batch_dims`, d_r)
          Relation embeddings.
      :param m_r: shape: (`*batch_dims`, d_e, d_r)
          The relation specific linear transformations.
      :param t: shape: (`*batch_dims`, d_e)
          Tail embeddings.
      :param p:
          The parameter p for selecting the norm.
      :param power_norm:
          Whether to return the powered norm instead.
  
      :return: shape: batch_dims
          The scores.
      """
      # project to relation specific subspace
      h_bot = einsum("...e, ...er -> ...r", h, m_r)
      t_bot = einsum("...e, ...er -> ...r", t, m_r)
      # ensure constraints
      h_bot = clamp_norm(h_bot, p=2, dim=-1, maxnorm=1.0)
      t_bot = clamp_norm(t_bot, p=2, dim=-1, maxnorm=1.0)
      return negative_norm_of_sum(
          h_bot, r, -t_bot, p=p, power_norm=power_norm
      )
  
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 22 for calling a global function with example usage: transr_interaction(h, r, t, m_r, p, power_norm) and returns: negative_norm_of_sum