class_docstr: Tests for :mod:`pykeen.utils`.
class_docstr_tok: ["Tests","for",":","mod",":","`","pykeen.utils","`","."]
docstr: Verify that our numpy implementation gives the same results as the torch variant.
docstr_tok: ["Verify","that","our","numpy","implementation","gives","the","same","results","as","the","torch","variant","."]
code: def test_logcumsumexp(self):
      """Verify that our numpy implementation gives the same results as the torch variant."""
      generator = numpy.random.default_rng(seed=42)
      a = generator.random(size=(21,))
      r1 = logcumsumexp(a)
      r2 = torch.logcumsumexp(torch.as_tensor(a), dim=0).numpy()
      numpy.testing.assert_allclose(r1, r2)
  
imports: import functools
  import itertools
  import operator
  import random
  import string
  import timeit
  import unittest
  from typing import Iterable, Tuple
  import numpy
  import pytest
  import torch
  from pykeen.utils import _weisfeiler_lehman_iteration, _weisfeiler_lehman_iteration_approx, calculate_broadcasted_elementwise_result_shape, clamp_norm, combine_complex, compact_mapping, compose, estimate_cost_of_sequence, flatten_dictionary, get_optimal_sequence, get_until_first_blank, iter_weisfeiler_lehman, logcumsumexp, project_entity, set_random_seed, split_complex, tensor_product, tensor_sum
label_desc: Use image node_id 11 for calling the TestUtils obj's underlying member method code with example usage: obj.test_logcumsumexp() without return types