code: def test_ubersum_sizes(impl, a, b, c, d):
      X = torch.randn(a, b)
      Y = torch.randn(b, c)
      Z = torch.randn(c, d)
      actual = impl(
          "ab,bc,cd->a,b,c,d", X, Y, Z, plates="ad", modulo_total=True
      )
      actual_a, actual_b, actual_c, actual_d = actual
      assert actual_a.shape == (a,)
      assert actual_b.shape == (b,)
      assert actual_c.shape == (c,)
      assert actual_d.shape == (d,)
  
imports: import itertools
  import numbers
  from collections import OrderedDict
  import opt_einsum
  import pytest
  import torch
  import pyro.ops.jit
  from pyro.distributions.util import logsumexp
  from pyro.ops.contract import _partition_terms, contract_tensor_tree, contract_to_tensor, einsum, naive_ubersum, ubersum
  from pyro.ops.einsum.adjoint import require_backward
  from pyro.ops.rings import LogRing
  from pyro.poutine.indep_messenger import CondIndepStackFrame
  from pyro.util import optional
  from tests.common import assert_equal
label_desc: Use image node_id 15 for calling a global function with example usage: test_ubersum_sizes(impl, a, b, c, d) without return types