class_docstr: Tests for the vectorized computation of KL divergences.
class_docstr_tok: ["Tests","for","the","vectorized","computation","of","KL","divergences","."]
docstr: Compare value against torch.distributions.
docstr_tok: ["Compare","value","against","torch.distributions","."]
code: def test_against_torch_builtin(self):
      """Compare value against torch.distributions."""
      # compute using pykeen
      h, r, t = [self._get(name=name) for name in "hrt"]
      sim = kullback_leibler_similarity(h=h, r=r, t=t, exact=True)
      sim2 = _torch_kl_similarity(h=h, r=r, t=t)
      self.assertTrue(
          torch.allclose(sim, sim2),
          msg=f"Difference: {(sim - sim2).abs()}",
      )
  
file_path: pykeen/tests/test_nn/test_sim.py
imports: import itertools
  import unittest
  import torch
  from pykeen.nn.sim import _torch_kl_similarity, kullback_leibler_similarity
  from pykeen.typing import GaussianDistribution
  from pykeen.utils import convert_to_canonical_shape
label_desc: Use image node_id 4 for calling the KullbackLeiblerTests obj's underlying member method code with example usage: obj.test_against_torch_builtin() without return types