code: def test_nn_module():
      import torch
  
      class Matmul(torch.nn.Module):
          def forward(
              self,
              x: Funsor,
              y: Funsor,
              i: Bound,
          ) -> Fresh[lambda x: x]:
              return (x * y).reduce(ops.add, i)
  
      matmul = make_funsor(Matmul())
  
      x = random_tensor(OrderedDict(a=Bint[3], b=Bint[4]))
      y = random_tensor(OrderedDict(c=Bint[4], d=Bint[3]))
      xy = matmul(x, y, "b")
      check_funsor(xy, {"a": Bint[3], "c": Bint[4], "d": Bint[3]}, Real)
  
imports: import math
  from collections import OrderedDict
  import pytest
  import funsor.ops
  from funsor.domains import Array, Bint, Real, Reals
  from funsor.factory import Bound, Fresh, Has, Value, make_funsor, to_funsor
  from funsor.interpretations import reflect
  from funsor.interpreter import reinterpret
  from funsor.tensor import Tensor
  from funsor.terms import Cat, Funsor, Lambda, Number, eager
  from funsor.testing import assert_close, check_funsor, random_tensor, requires_backend
label_desc: Use image node_id 8 for calling a global function with example usage: test_nn_module() and returns: unknown