code: def tucker_interaction(
      h: torch.FloatTensor,
      r: torch.FloatTensor,
      t: torch.FloatTensor,
      core_tensor: torch.FloatTensor,
      do_h: nn.Dropout,
      do_r: nn.Dropout,
      do_hr: nn.Dropout,
      bn_h: Optional[nn.BatchNorm1d],
      bn_hr: Optional[nn.BatchNorm1d],
  ) -> torch.FloatTensor:
      r"""Evaluate the TuckEr interaction function.
  
      Compute scoring function W x_1 h x_2 r x_3 t as in the official implementation, i.e. as
  
      .. math ::
  
          DO_{hr}(BN_{hr}(DO_h(BN_h(h)) x_1 DO_r(W x_2 r))) x_3 t
  
      where BN denotes BatchNorm and DO denotes Dropout
  
      :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 core_tensor: shape: (d_e, d_r, d_e)
          The core tensor.
      :param do_h:
          The dropout layer for the head representations.
      :param do_r:
          The first hidden dropout.
      :param do_hr:
          The second hidden dropout.
      :param bn_h:
          The first batch normalization layer.
      :param bn_hr:
          The second batch normalization layer.
  
      :return: shape: batch_dims
          The scores.
      """
      return (
          _apply_optional_bn_to_tensor(
              x=einsum(
                  # x_1 contraction
                  "...ik,...i->...k",
                  _apply_optional_bn_to_tensor(
                      x=einsum(
                          # x_2 contraction
                          "ijk,...j->...ik",
                          core_tensor,
                          r,
                      ),
                      output_dropout=do_r,
                  ),
                  _apply_optional_bn_to_tensor(
                      x=h,
                      batch_norm=bn_h,
                      output_dropout=do_h,
                  ),
              ),
              batch_norm=bn_hr,
              output_dropout=do_hr,
          )
          * t
      ).sum(dim=-1)
  
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 23 for calling a global function with example usage: tucker_interaction(h, r, t, core_tensor, do_h, do_r, do_hr, bn_h, bn_hr) and returns: unknown