code: def test_ubersum_2(impl):
      # y {a}   z {b}  <--- target
      #      \  /
      #     x {}
      a, b, c, d, e = 2, 3, 4, 5, 6
      x = torch.randn(c)
      y = torch.randn(c, d, a)
      z = torch.randn(e, c, b)
      (actual,) = impl(
          "c,cda,ecb->b", x, y, z, plates="ab", modulo_total=True
      )
      xyz = logsumexp(
          x + logsumexp(y, -2).sum(-1) + logsumexp(z, -3).sum(-1), -1
      )
      expected = xyz.expand(b)
      assert_equal(actual, expected)
  
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 17 for calling a global function with example usage: test_ubersum_2(impl) without return types