code: def test_canonicalize(self):
      ir = """
  graph(%p207 : Tensor,
        %1 : Tensor,
        %p407 : int):
    %11 : Tensor = aten::view_expand_placeholder(%1)
    %12 : Tensor = aten::pointwise_placeholder(%11, %p207, %p407)
    %13 : Tensor = aten::view_expand_placeholder(%12)
    %14 : Tensor = aten::pointwise_placeholder(%13)
    return (%14)
          """
  
      graph1 = torch._C.parse_ir(ir)
      graph1 = torch._C._jit_pass_canonicalize(graph1, True)
  
      graph2 = torch._C.parse_ir(ir)
      graph2 = torch._C._jit_pass_canonicalize(graph2)
  
      self.assertEqual(str(graph1), str(graph2))
      FileCheck().check("%p207").check_not("%14").run(graph1)
  
      graph3 = torch._C.parse_ir(ir)
      graph3 = torch._C._jit_pass_canonicalize(graph3, False)
      FileCheck().check_not("%p207").run(graph3)
  
file_path: pytorch/test/jit/test_python_bindings.py
imports: import torch
  from torch.testing import FileCheck
  from torch.testing._internal.jit_utils import JitTestCase
label_desc: Use image node_id 8 for calling the TestPythonBindings obj's underlying member method code with example usage: obj.test_canonicalize() without return types