code: def test_DPTuner_run():
      log_file = "%s/test_tuner.log" % (os.getcwd())
      target = "llvm"
      dtype = "float32"
      layout = "NCHW"
      dshape = (1, 3, 8, 8)
      conv2d = relay.op.get("nn.conv2d")
      target_ops = [conv2d]
  
      g, records, ltf_records, ltf_keys, tasks = _create_data(
          target, dshape, dtype, layout
      )
      mod = tvm.IRModule()
      mod["main"] = g
      costs = [0.02, 0.02, 0.045]
      config_list = []
      cfg_dict = {
          "index": -1,
          "code_hash": None,
          "entity": [
              ["tile_ic", "sp", [1, 3]],
              ["tile_oc", "sp", [2, 8]],
              ["tile_ow", "sp", [4, 2]],
              ["unroll_kw", "ot", True],
          ],
      }
      config_list.append(ConfigEntity.from_json_dict(cfg_dict))
      cfg_dict = {
          "index": -1,
          "code_hash": None,
          "entity": [
              ["tile_ic", "sp", [4, 4]],
              ["tile_oc", "sp", [2, 16]],
              ["tile_oh", "ot", 1],
              ["tile_ow", "sp", [4, 2]],
          ],
      }
      config_list.append(ConfigEntity.from_json_dict(cfg_dict))
      cfg_dict = {
          "index": -1,
          "code_hash": None,
          "entity": [
              ["tile_ic", "sp", [16, 2]],
              ["tile_oc", "sp", [8, 4]],
              ["tile_ow", "sp", [2, 4]],
              ["unroll_kw", "ot", False],
          ],
      }
      config_list.append(ConfigEntity.from_json_dict(cfg_dict))
      for cost, config, task in zip(costs, config_list, tasks):
          ms_input = MeasureInput(
              target=target, task=task, config=config
          )
          ms_output = MeasureResult(
              costs=(cost,), error_no=0, all_cost=-1, timestamp=-1
          )
          records.append((ms_input, ms_output))
  
      executor = DPTuner(
          mod,
          {"data": dshape},
          records,
          target_ops,
          target,
          log_file=log_file,
      )
      executor.benchmark_layout_transform(
          layout_records=ltf_records, infer_layout=True
      )
      executor.run()
      out = [
          record[0].config for record in executor.get_optimal_records()
      ]
      expected_out = [
          records[3][0].config,
          records[1][0].config,
          records[2][0].config,
      ]
      assert (
          expected_out == out
      ), "Output mismatch: expecting %s but got %s" % (
          str(expected_out),
          str(out),
      )
      assert os.path.isfile(log_file), (
          "No log file with name %s exists." % log_file
      )
  
file_path: tvm/tests/python/autotvm/test_autotvm_graph_tuner_core.py
imports: import os
  import copy
  import numpy
  import tvm
  from tvm import te
  import tvm.relay.testing
  from tvm import autotvm
  from tvm import relay
  from tvm.autotvm.task import ConfigEntity
  from tvm.autotvm.measure import MeasureResult, MeasureInput
  from tvm.autotvm.graph_tuner import DPTuner, PBQPTuner
label_desc: Use image node_id 5 for calling a global function with example usage: test_DPTuner_run() without return types