code: def test_task_extraction():
      target = "llvm"
      mod_list = []
      params_list = []
      conv2d = relay.op.get("nn.conv2d")
      conv3d = relay.op.get("nn.conv3d")
      conv2d_transpose = relay.op.get("nn.conv2d_transpose")
      dense = relay.op.get("nn.dense")
  
      mod, params, _ = get_network("resnet-18", batch_size=1)
      tasks = autotvm.task.extract_from_program(
          mod["main"], target=target, params=params, ops=(conv2d,)
      )
      assert len(tasks) == 12
      tasks = autotvm.task.extract_from_program(
          mod, target=target, params=params, ops=(conv2d,)
      )
      assert len(tasks) == 12
  
      mod, params, _ = get_network("resnet-18", batch_size=1)
      tasks = autotvm.task.extract_from_program(
          mod["main"], target=target, params=params, ops=(dense,)
      )
      assert len(tasks) == 2
      tasks = autotvm.task.extract_from_program(
          mod, target=target, params=params, ops=(dense,)
      )
      assert len(tasks) == 2
  
      mod, params, _ = get_network("resnet-18", batch_size=1)
      mod_list.append(mod)
      params_list.append(params)
      tasks = autotvm.task.extract_from_program(
          mod["main"], target=target, params=params, ops=(conv2d, dense)
      )
      assert len(tasks) == 14
      tasks = autotvm.task.extract_from_program(
          mod, target=target, params=params, ops=(conv2d, dense)
      )
      assert len(tasks) == 14
      tasks = autotvm.task.extract_from_program(
          mod, target=target, params=params
      )
      assert len(tasks) == 14
  
      mod, params, _ = get_network("resnet3d-18", batch_size=1)
      tasks = autotvm.task.extract_from_program(
          mod, target=target, params=params, ops=(conv3d,)
      )
      assert len(tasks) == 12
  
      mod, params, _ = get_network("mobilenet", batch_size=1)
      mod_list.append(mod)
      params_list.append(params)
      tasks = autotvm.task.extract_from_program(
          mod, target=target, params=params, ops=(conv2d, dense)
      )
      assert len(tasks) == 21
  
      mod, params, _ = get_network("dcgan", batch_size=1)
      tasks = autotvm.task.extract_from_program(
          mod, target=target, params=params, ops=(conv2d_transpose,)
      )
      assert len(tasks) == 4
  
      tasks = autotvm.task.extract_from_multiple_program(
          mod_list, params_list, target=target, ops=(conv2d,)
      )
      assert len(tasks) == 31
  
imports: import tvm.relay.testing
  from tvm import relay
  from tvm import autotvm
label_desc: Use image node_id 2 for calling a global function with example usage: test_task_extraction() without return types