code: def run_tuning():
      print("Begin tuning...")
      tuner = auto_scheduler.TaskScheduler(tasks, task_weights)
      tune_option = auto_scheduler.TuningOptions(
          num_measure_trials=200,  # change this to 20000 to achieve the best performance
          runner=auto_scheduler.LocalRunner(
              repeat=10, enable_cpu_cache_flush=True
          ),
          measure_callbacks=[auto_scheduler.RecordToFile(log_file)],
      )
  
      if use_sparse:
          from tvm.topi.sparse.utils import sparse_sketch_rules
  
          search_policy = [
              auto_scheduler.SketchPolicy(
                  task,
                  program_cost_model=auto_scheduler.XGBModel(),
                  init_search_callbacks=sparse_sketch_rules(),
              )
              for task in tasks
          ]
  
          tuner.tune(tune_option, search_policy=search_policy)
      else:
          tuner.tune(tune_option)
  
file_path: tvm/gallery/how_to/tune_with_autoscheduler/tune_network_x86.py
imports: import numpy
  import tvm
  from tvm import relay, auto_scheduler
  from tvm.relay import data_dep_optimization
  import tvm.relay.testing
  from tvm.contrib import graph_executor
label_desc: Use image node_id 2 for calling a global function with example usage: run_tuning() without return types