code: def test_rewrite_layout_link_params_1x1_conv2d():
      I, O, H, W = 32, 16, 256, 256
      kH = kW = 1
  
      strides = (1, 1)
      padding = (0, 0)
  
      data_shape = (1, H, W, I)
      w_shape = (kH, kW, I, O)
  
      data = relay.var("data", shape=data_shape, dtype="float32")
      weight = relay.var("weight", shape=w_shape, dtype="float32")
  
      conv = relay.nn.conv2d(
          data=data,
          weight=weight,
          kernel_size=(kH, kW),
          channels=O,
          padding=padding,
          strides=strides,
          data_layout="NHWC",
          kernel_layout="HWIO",
          out_dtype="float32",
      )
  
      mod = tvm.IRModule.from_expr(conv)
  
      weight_np = np.random.randn(*w_shape).astype("float32")
  
      params = {"weight": weight_np}
  
      data_np = np.random.randn(*data_shape).astype("float32")
  
      ref = (
          relay.create_executor(
              "graph", mod=mod, device=tvm.cpu(0), target="llvm"
          )
          .evaluate()(*[data_np, weight_np])
          .numpy()
      )
  
      link_params = True
  
      target = "llvm --num-cores=4"
  
      executor = relay.backend.Executor(
          "graph", {"link-params": link_params}
      )
      mod = mod.with_attr("executor", executor)
  
      with tempfile.TemporaryDirectory() as work_dir:
          database = ms.relay_integration.tune_relay(
              mod=mod,
              target=target,
              params=params,
              work_dir=work_dir,
              max_trials_global=8,
              strategy="replay-trace",
          )
  
          lib = ms.relay_integration.compile_relay(
              database=database,
              mod=mod,
              target=target,
              params=params,
          )
  
      dev = tvm.device(target, 0)
      runtime = tvm.contrib.graph_executor.GraphModule(
          lib["default"](dev)
      )
  
      runtime.set_input("data", data_np)
      runtime.run()
  
      out = runtime.get_output(0).numpy()
  
      np.testing.assert_allclose(ref, out, rtol=1e-4, atol=1e-4)
  
imports: import platform
  import tempfile
  from typing import List
  import numpy
  import pytest
  import tvm
  import tvm.testing
  from tvm import IRModule
  from tvm import meta_schedule
  from tvm import relay, te, tir
  from tvm._ffi import register_func
  from tvm.contrib import graph_executor
  from tvm.ir.transform import PassContext
  from tvm.meta_schedule.database import TuningRecord, Workload
  from tvm.meta_schedule.testing.relay_workload import get_network
  from tvm.meta_schedule.testing.tlcbench import load_quantized_bert_base
  from tvm.meta_schedule.tune_context import _normalize_mod
  from tvm.script import tir
  from tvm.target import Target
label_desc: Use image node_id 18 for calling a global function with example usage: test_rewrite_layout_link_params_1x1_conv2d() without return types