code: def _optimize_graph(graph, aten, export_raw_ir=False):
      # run dce first to eliminate dead parts of the graph that might have been
      # left behind by things like symbolic_override
  
      torch._C._jit_pass_dce(graph)
      torch._C._jit_pass_lint(graph)
  
      torch._C._jit_pass_peephole(graph)
      torch._C._jit_pass_lint(graph)
      if not export_raw_ir:
          graph = torch._C._jit_pass_onnx(graph, aten)
          torch._C._jit_pass_lint(graph)
          torch._C._jit_pass_onnx_peephole(graph)
          torch._C._jit_pass_lint(graph)
      torch._C._jit_pass_dce(graph)
      torch._C._jit_pass_lint(graph)
      graph = torch._C._jit_pass_canonicalize(graph)
      torch._C._jit_pass_lint(graph)
      return graph
  
imports: from mmdnn.conversion.common.DataStructure.graph import GraphNode, Graph
  import torch
  import torch.autograd
  import torch.serialization
  import contextlib
  from torch.jit import _unique_state_dict
label_desc: Use image node_id 6 for calling the PytorchGraph040 obj's underlying member method code with example usage: obj._optimize_graph(graph, aten, export_raw_ir) and returns: graph