code: def test_subs_reduce():
      x = random_tensor(
          OrderedDict([("i", Bint[3]), ("j", Bint[2])]), Real
      )
      ix = random_tensor(OrderedDict([("i", Bint[3])]), Bint[2])
      ix2 = ix(i="i2")
      with reflect:
          actual = x.reduce(ops.add, frozenset({"i"}))
      actual = actual(j=ix)
      expected = x(j=ix2).reduce(ops.add, frozenset({"i"}))(i2="i")
      assert_close(actual, expected)
  
file_path: funsor/test/test_alpha_conversion.py
imports: from collections import OrderedDict
  import numpy
  import pytest
  import funsor.ops
  from funsor.domains import Bint, Real, Reals
  from funsor.interpreter import gensym, reinterpret
  from funsor.terms import Cat, Independent, Lambda, Number, Slice, Stack, Variable, reflect
  from funsor.testing import assert_close, check_funsor, random_tensor
  from funsor.util import get_backend
label_desc: Use image node_id 2 for calling a global function with example usage: test_subs_reduce() without return types