code: def _get_conv2d_impl(dtype, target):
      """Returns selected conv2d implementation for a given datatype and target"""
      data_shape = (1, 1, 1, 4)
      weight_shape = (1, 1, 4, 4)
      data_layout = "NHWC"
      kernel_layout = "HWIO"
      channels = 4
      kernel_size = (1, 1)
  
      out = relay.nn.conv2d(
          relay.var("data", shape=data_shape, dtype=dtype),
          relay.var("weight", shape=weight_shape, dtype=dtype),
          kernel_size=kernel_size,
          channels=channels,
          data_layout=data_layout,
          kernel_layout=kernel_layout,
          out_dtype=dtype,
      )
  
      with target:
          out = run_opt_pass(out, relay.transform.AlterOpLayout())
          impl, _ = relay.backend.te_compiler.select_implementation(
              out.op,
              out.attrs,
              [
                  te.placeholder(data_shape, dtype),
                  te.placeholder(weight_shape, dtype),
              ],
              out.checked_type,
              target,
              use_autotvm=False,
          )
  
      return impl.name
  
file_path: tvm/tests/python/relay/strategy/test_select_implementation.py
imports: import pytest
  import numpy
  from unittest.mock import MagicMock
  import tvm
  from tvm import relay
  from tvm import te
  from tvm.relay.testing import run_infer_type, run_opt_pass
  import tvm.testing
  from tvm import topi
label_desc: Use image node_id 2 for calling a global function with example usage: _get_conv2d_impl(dtype, target) and returns: impl