code: def transd_interaction(
      h: torch.FloatTensor,
      r: torch.FloatTensor,
      t: torch.FloatTensor,
      h_p: torch.FloatTensor,
      r_p: torch.FloatTensor,
      t_p: torch.FloatTensor,
      p: int,
      power_norm: bool = False,
  ) -> torch.FloatTensor:
      """Evaluate the TransD interaction function.
  
      :param h: shape: (`*batch_dims`, d_e)
          The head representations.
      :param r: shape: (`*batch_dims`, d_r)
          The relation representations.
      :param t: shape: (`*batch_dims`, d_e)
          The tail representations.
      :param h_p: shape: (`*batch_dims`, d_e)
          The head projections.
      :param r_p: shape: (`*batch_dims`, d_r)
          The relation projections.
      :param t_p: shape: (`*batch_dims`, d_e)
          The tail projections.
      :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 entities
      h_bot = project_entity(
          e=h,
          e_p=h_p,
          r_p=r_p,
      )
      t_bot = project_entity(
          e=t,
          e_p=t_p,
          r_p=r_p,
      )
      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 18 for calling a global function with example usage: transd_interaction(h, r, t, h_p, r_p, t_p, p, power_norm) and returns: negative_norm_of_sum