code: def test_expr2graph():
      mod, _ = synthetic.get_workload()
      node_dict = {}
      node_list = []
      target_ops = [relay.op.get("nn.conv2d")]
      op_name_list = []
  
      def _count_node(node):
          if isinstance(node, Call):
              op_name_list.append(node.op)
          elif isinstance(node, (Var, TupleGetItem, Tuple)):
              op_name_list.append(None)
  
      relay.analysis.post_order_visit(mod["main"], _count_node)
  
      expr2graph(
          mod["main"],
          target_ops,
          node_dict,
          node_list,
          tvm.target.Target("llvm"),
      )
      assert len(node_list) == len(op_name_list)
      for i, item in enumerate(zip(op_name_list, node_list)):
          op_name, node = item
          assert (
              op_name == node["op"]
          ), "%dth Node operator mismatch: expecting %s but got %s" % (
              i,
              str(op_name),
              str(node["op"]),
          )
  
file_path: tvm/tests/python/autotvm/test_autotvm_graph_tuner_utils.py
imports: import pytest
  import tvm
  from tvm import te
  from tvm import autotvm, relay
  from tvm.relay.testing import synthetic
  from tvm.autotvm.graph_tuner.utils import has_multiple_inputs, get_direct_ancestor, get_in_nodes, get_out_nodes, expr2graph, bind_inputs
  from tvm.autotvm.graph_tuner._base import OPT_OUT_OP
  from tvm.autotvm.graph_tuner.utils.traverse_graph import _replace_device_with_tracing
  from tvm.relay.expr import Call, TupleGetItem, Tuple, Var
label_desc: Use image node_id 3 for calling a global function with example usage: test_expr2graph() without return types