code: def test_eager_contract_tensor_tensor(
      red_op, bin_op, x_inputs, x_shape, y_inputs, y_shape
  ):
      backend = get_backend()
      inputs = OrderedDict(
          [("i", Bint[4]), ("j", Bint[5]), ("k", Bint[6])]
      )
      x_inputs = OrderedDict(
          (k, v) for k, v in inputs.items() if k in x_inputs
      )
      y_inputs = OrderedDict(
          (k, v) for k, v in inputs.items() if k in y_inputs
      )
      x = random_tensor(x_inputs, Reals[x_shape])
      y = random_tensor(y_inputs, Reals[y_shape])
  
      xy = bin_op(x, y)
      all_vars = x.input_vars | y.input_vars
      for n in range(len(all_vars)):
          for reduced_vars in map(
              frozenset, itertools.combinations(all_vars, n)
          ):
              print("reduced_vars = {}".format(reduced_vars))
              expected = xy.reduce(red_op, reduced_vars)
              actual = Contraction(red_op, bin_op, reduced_vars, (x, y))
              assert_close(
                  actual,
                  expected,
                  atol=1e-4,
                  rtol=1e-3 if backend == "jax" else 1e-4,
              )
  
imports: import itertools
  from collections import OrderedDict
  import numpy
  import pytest
  from funsor import ops
  from funsor.cnf import BACKEND_TO_EINSUM_BACKEND, BACKEND_TO_LOGSUMEXP_BACKEND, Contraction
  from funsor.constant import Constant
  from funsor.delta import Delta
  from funsor.domains import Array, Bint, Real, Reals
  from funsor.einsum import einsum, naive_plated_einsum
  from funsor.integrate import Integrate
  from funsor.interpretations import eager, normalize, reflect
  from funsor.interpreter import reinterpret
  from funsor.optimizer import apply_optimizer
  from funsor.tensor import Tensor
  from funsor.terms import Number
  from funsor.testing import assert_close, check_funsor, make_einsum_example, random_tensor
  from funsor.util import get_backend, quote
label_desc: Use image node_id 2 for calling a global function with example usage: test_eager_contract_tensor_tensor(red_op, bin_op, x_inputs, x_shape, y_inputs, y_shape) without return types