code: def test_match_equivalent_function_invocations2(self):
      counter = 0
      test_pass = PatternMatcherPass(
          prevent_match_across_mutations=True
      )
  
      args = [
          torch.randn(20, device="cuda"),
          torch.randn(10, 15, device="cuda"),
          torch.randn(15, 20, device="cuda"),
      ]
  
      def f0(inp, a, b):
          return torch.ops.aten.addmm(inp, a, b)
  
      def f1(inp, a, b):
          return torch.ops.aten.addmm(inp, a, b, beta=1.0)
  
      def f2(inp, a, b):
          return torch.ops.aten.addmm(inp, a, b, beta=1.0, alpha=1.0)
  
      # This graph pattern should only match f0
      @register_graph_pattern(
          CallFunction(torch.ops.aten.addmm, Arg(), Arg(), Arg()),
          pass_dict=test_pass,
      )
      def addmm_replacement(match: Match, inp, mat1, mat2):
          nonlocal counter
          counter += 1
  
          def repl(inp, x1, x2):
              return x1 @ x2 + inp
  
          with V.fake_mode:
              match.replace_by_example(repl, [inp, mat1, mat2])
  
      with unittest.mock.patch(
          "torch._inductor.fx_passes.post_grad.pass_patterns",
          torch._inductor.fx_passes.post_grad.pass_patterns
          + [test_pass],
      ):
          for fn in (f0, f1, f2):
              counter = 0
              expected = fn(*copy.deepcopy(args))
              actual = torch.compile(fn)(*copy.deepcopy(args))
              self.assertEqual(counter, 1)
              torch.testing.assert_close(actual, expected)
  
imports: import copy
  import unittest
  import torch
  import torch._dynamo.config
  import torch._inductor.config
  from torch._dynamo.test_case import run_tests, TestCase
  from torch._dynamo.utils import count_calls, counters
  from torch._higher_order_ops.out_dtype import out_dtype
  from torch._inductor.fx_passes import joint_graph
  from torch._inductor.fx_passes.serialized_patterns.central_index import get_serialized_pattern
  from torch._inductor.pattern_matcher import _TargetExpr, Arg, CallFunction, gen_pattern, KeywordArg, Match, PatternExpr, PatternMatcherPass, PatternPrettyPrinter, register_graph_pattern, stable_topological_sort
  from torch._inductor.utils import run_and_get_code
  from torch._inductor.virtualized import V
  from torch.testing import FileCheck
  from torch.testing._internal.common_cuda import SM80OrLater
  from torch.testing._internal.common_utils import IS_LINUX, skipIfRocm
  from torch.testing._internal.inductor_utils import HAS_CUDA
label_desc: Use image node_id 33 for calling the TestPatternMatcher obj's underlying member method code with example usage: obj.test_match_equivalent_function_invocations2() and returns: torch, torch, torch, unknown