code: def convkb_interaction(
      h: torch.FloatTensor,
      r: torch.FloatTensor,
      t: torch.FloatTensor,
      conv: nn.Conv2d,
      activation: nn.Module,
      hidden_dropout: nn.Dropout,
      linear: nn.Linear,
  ) -> torch.FloatTensor:
      r"""Evaluate the ConvKB interaction function.
  
      .. math::
          W_L drop(act(W_C \ast ([h; r; t]) + b_C)) + b_L
  
      :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 conv:
          The 3x1 convolution.
      :param activation:
          The activation function.
      :param hidden_dropout:
          The dropout layer applied to the hidden activations.
      :param linear:
          The final linear layer.
  
      :return: shape: batch_dims
          The scores.
      """
      # cat into shape (..., 1, d, 3)
      x = torch.stack(
          torch.broadcast_tensors(h, r, t), dim=-1
      ).unsqueeze(dim=-3)
      s = x.shape
      x = x.view(-1, *s[-3:])
      x = conv(x)
      x = x.view(*s[:-3], -1)
      x = activation(x)
  
      # Apply dropout, cf. https://github.com/daiquocnguyen/ConvKB/blob/master/model.py#L54-L56
      x = hidden_dropout(x)
  
      # Linear layer for final scores; use flattened representations, shape: (*batch_dims, d * f)
      x = linear(x)
      return x.squeeze(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 4 for calling a global function with example usage: convkb_interaction(h, r, t, conv, activation, hidden_dropout, linear) and returns: x