code: def verify_conv2d(data_dtype, conv_dtype, tensor_format=0, groups=1):
      in_channel = 4
      out_channel = 16
      filter_h = 3
      filter_w = 3
      pad_h = 1
      pad_w = 1
      stride_h = 1
      stride_w = 1
      dilation_h = 1
      dilation_w = 1
      batch = 3
      height = 32
      width = 32
  
      if data_dtype == "float16" and not have_fp16(
          tvm.cuda(0).compute_version
      ):
          print("Skip because gpu does not have fp16 support")
          return
  
      # schedule
      if tensor_format == 0:
          xshape = [batch, in_channel, height, width]
          wshape = [
              out_channel,
              in_channel // groups,
              filter_h,
              filter_w,
          ]
      else:
          xshape = [batch, height, width, in_channel]
          wshape = [
              out_channel,
              filter_h,
              filter_w,
              in_channel // groups,
          ]
  
      X = te.placeholder(xshape, name="X", dtype=data_dtype)
      W = te.placeholder(wshape, name="W", dtype=data_dtype)
      Y = cudnn.conv_forward(
          X,
          W,
          [pad_h, pad_w],
          [stride_h, stride_w],
          [dilation_h, dilation_w],
          conv_mode=1,
          tensor_format=tensor_format,
          conv_dtype=conv_dtype,
          algo=-1,
          groups=groups,
      )
      yshape = [x.value for x in Y.shape]
      s = te.create_schedule(Y.op)
  
      # validation
      dev = tvm.cuda(0)
      f = tvm.build(s, [X, W, Y], "cuda --host=llvm", name="conv2d")
      x_np = np.random.uniform(-1, 1, xshape).astype(data_dtype)
      w_np = np.random.uniform(-1, 1, wshape).astype(data_dtype)
      y_np = np.zeros(yshape).astype(data_dtype)
      x = tvm.nd.array(x_np, dev)
      w = tvm.nd.array(w_np, dev)
      y = tvm.nd.array(y_np, dev)
      if tensor_format == 0:
          c_np = tvm.topi.testing.conv2d_nchw_python(
              x_np, w_np, 1, 1, groups=groups
          )
      elif tensor_format == 1:
          wt = w_np.transpose((1, 2, 3, 0))  # OHWI => HWIO
          c_np = tvm.topi.testing.conv2d_nhwc_python(
              x_np, wt, 1, 1, groups=groups
          )
  
      f(x, w, y)
      tvm.testing.assert_allclose(y.numpy(), c_np, atol=1e-2, rtol=1e-2)
  
imports: import sys
  import pytest
  import tvm
  import tvm.testing
  from tvm import te
  from tvm import relay
  from tvm.contrib import cudnn
  from tvm.contrib.nvcc import have_fp16
  from tvm.contrib import graph_executor
  import numpy
  import tvm.topi.testing
  import tvm.testing
  from tvm.relay.op.contrib.cudnn import partition_for_cudnn
label_desc: Use image node_id 1 for calling a global function with example usage: verify_conv2d(data_dtype, conv_dtype, tensor_format, groups) without return types