class_docstr: Tests for :mod:`pykeen.utils`.
class_docstr_tok: ["Tests","for",":","mod",":","`","pykeen.utils","`","."]
docstr: Test calculate_broadcasted_elementwise_result_shape.
docstr_tok: ["Test","calculate_broadcasted_elementwise_result_shape","."]
code: def test_calculate_broadcasted_elementwise_result_shape(self):
      """Test calculate_broadcasted_elementwise_result_shape."""
      max_dim = 64
      for n_dim, _ in itertools.product(range(2, 5), range(10)):
          a_shape = [1 for _ in range(n_dim)]
          b_shape = [1 for _ in range(n_dim)]
          for j in range(n_dim):
              dim = 2 + random.randrange(max_dim)
              mod = random.randrange(3)
              if mod % 2 == 0:
                  a_shape[j] = dim
              if mod > 0:
                  b_shape[j] = dim
              a = torch.empty(*a_shape)
              b = torch.empty(*b_shape)
              shape = calculate_broadcasted_elementwise_result_shape(
                  first=a.shape, second=b.shape
              )
              c = a + b
              exp_shape = c.shape
              assert shape == exp_shape
  
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 5 for calling the TestUtils obj's underlying member method code with example usage: obj.test_calculate_broadcasted_elementwise_result_shape() without return types