code: def conve_interaction(
      h: torch.FloatTensor,
      r: torch.FloatTensor,
      t: torch.FloatTensor,
      t_bias: torch.FloatTensor,
      input_channels: int,
      embedding_height: int,
      embedding_width: int,
      hr2d: nn.Module,
      hr1d: nn.Module,
  ) -> torch.FloatTensor:
      """Evaluate the ConvE interaction function.
  
      :param h: shape: (`*batch_dims`, dim)
          The head representations.
      :param r: shape: (`*batch_dims`, dim)
          The relation representations.
      :param t: shape: (`*batch_dims`, dim)
          The tail representations.
      :param t_bias: shape: (`*batch_dims`)
          The tail entity bias.
      :param input_channels:
          The number of input channels.
      :param embedding_height:
          The height of the reshaped embedding.
      :param embedding_width:
          The width of the reshaped embedding.
      :param hr2d:
          The first module, transforming the 2D stacked head-relation "image".
      :param hr1d:
          The second module, transforming the 1D flattened output of the 2D module.
  
      :return: shape: batch_dims
          The scores.
      """
      # repeat if necessary, and concat head and relation
      # shape: -1, num_input_channels, 2*height, width
      x = torch.cat(
          torch.broadcast_tensors(
              h.view(
                  *h.shape[:-1],
                  input_channels,
                  embedding_height,
                  embedding_width,
              ),
              r.view(
                  *r.shape[:-1],
                  input_channels,
                  embedding_height,
                  embedding_width,
              ),
          ),
          dim=-2,
      )
      prefix_shape = x.shape[:-3]
      x = x.view(
          -1, input_channels, 2 * embedding_height, embedding_width
      )
  
      # shape: -1, num_input_channels, 2*height, width
      x = hr2d(x)
  
      # -1, num_output_channels * (2 * height - kernel_height + 1) * (width - kernel_width + 1)
      x = x.view(-1, numpy.prod(x.shape[-3:]))
      x = hr1d(x)
  
      # reshape: (-1, dim) -> (*batch_dims, dim)
      x = x.view(*prefix_shape, h.shape[-1])
  
      # For efficient calculation, each of the convolved [h, r] rows has only to be multiplied with one t row
      # output_shape: batch_dims
      x = einsum("...d, ...d -> ...", x, t)
  
      # add bias term
      return x + t_bias
  
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 3 for calling a global function with example usage: conve_interaction(h, r, t, t_bias, input_channels, embedding_height, embedding_width, hr2d, hr1d) and returns: unknown