code: def _torch_kl_similarity(
      h: GaussianDistribution,
      r: GaussianDistribution,
      t: GaussianDistribution,
  ) -> torch.FloatTensor:
      """Compute KL similarity using torch.distributions.
  
      :param h: shape: (batch_size, num_heads, 1, 1, d)
          The head entity Gaussian distribution.
      :param r: shape: (batch_size, 1, num_relations, 1, d)
          The relation Gaussian distribution.
      :param t: shape: (batch_size, 1, 1, num_tails, d)
          The tail entity Gaussian distribution.
      :return: torch.Tensor, shape: (s_1, ..., s_k)
          The KL-divergence.
  
      .. warning ::
          Do not use this method in production code.
      """
      e_mean = h.mean - t.mean
      e_var = h.diagonal_covariance + t.diagonal_covariance
  
      # allocate result
      (
          batch_size,
          num_heads,
          num_relations,
          num_tails,
      ) = calculate_broadcasted_elementwise_result_shape(
          e_mean.shape,
          r.mean.shape,
      )[
          :-1
      ]
      result = h.mean.new_empty(
          batch_size, num_heads, num_relations, num_tails
      )
      for bi, hi, ri, ti in itertools.product(
          range(batch_size),
          range(num_heads),
          range(num_relations),
          range(num_tails),
      ):
          # prepare distributions
          e_loc = e_mean[bi, hi, 0, ti, :]
          r_loc = r.mean[bi, 0, ri, 0, :]
          e_cov = torch.diag(e_var[bi, hi, 0, ti, :])
          r_cov = torch.diag(r.diagonal_covariance[bi, 0, ri, 0, :])
          p = torch.distributions.MultivariateNormal(
              loc=e_loc,
              covariance_matrix=e_cov,
          )
          q = torch.distributions.MultivariateNormal(
              loc=r_loc,
              covariance_matrix=r_cov,
          )
          result[bi, hi, ri, ti] = torch.distributions.kl_divergence(
              p=p, q=q
          ).view(-1)
      return -result
  
file_path: pykeen/src/pykeen/nn/sim.py
imports: import itertools
  import math
  import torch
  from .compute_kernel import batched_dot
  from ..typing import GaussianDistribution
  from ..utils import at_least_eps, calculate_broadcasted_elementwise_result_shape, tensor_sum
label_desc: Use image node_id 4 for calling a global function with example usage: _torch_kl_similarity(h, r, t) and returns: unknown