code: def test_pointless_convert(self):
      def fn1(x):
          x = torch.ops.prims.convert_element_type.default(
              x, torch.float16
          )
          x = torch.ops.prims.convert_element_type.default(
              x, torch.float32
          )
          return x
  
      gm = torch.fx.symbolic_trace(fn1)
      self.assertEqual(count_calls(gm.graph), 2)
      joint_graph.joint_graph_passes(gm)
      self.assertEqual(count_calls(gm.graph), 1)
  
      def fn2(x):
          x = torch.ops.prims.convert_element_type.default(
              x, torch.int32
          )
          x = torch.ops.prims.convert_element_type.default(
              x, torch.float32
          )
          return x
  
      gm = torch.fx.symbolic_trace(fn2)
      self.assertEqual(count_calls(gm.graph), 2)
      joint_graph.joint_graph_passes(gm)
      self.assertEqual(count_calls(gm.graph), 2)
  
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 22 for calling the TestPatternMatcher obj's underlying member method code with example usage: obj.test_pointless_convert() and returns: x, x