code: def verify_conv2d_backward_filter(
      data_dtype, conv_dtype, tensor_format=0, tol=1e-5
  ):
      batch = 3
      in_channel = 4
      out_channel = 16
      filter_h, filter_w = 3, 3
      pad_h, pad_w = 1, 1
      stride_h, stride_w = 1, 1
      height, width = 32, 32
  
      if tensor_format == 0:
          x_shape = [batch, in_channel, height, width]
          dy_shape = [batch, out_channel, height, width]
      else:
          x_shape = [batch, height, width, in_channel]
          dy_shape = [batch, height, width, out_channel]
  
      x_np = np.random.uniform(-1, 1, x_shape).astype(data_dtype)
      dy_np = np.random.uniform(-1, 1, dy_shape).astype(data_dtype)
  
      dw_np = tvm.topi.testing.conv2d_backward_weight_python(
          dy_np,
          x_np,
          (filter_h, filter_w),
          (stride_h, stride_w),
          (pad_h, pad_w),
          "NCHW" if tensor_format == 0 else "NHWC",
      )
  
      x = te.placeholder(x_shape, name="x", dtype=data_dtype)
      dy = te.placeholder(dy_shape, name="dy", dtype=data_dtype)
      dw = cudnn.conv_backward_filter(
          dy,
          x,
          (filter_h, filter_w),
          [pad_h, pad_w],
          [stride_h, stride_w],
          [1, 1],
          conv_mode=1,
          tensor_format=tensor_format,
          conv_dtype=conv_dtype,
      )
  
      s = te.create_schedule(dw.op)
  
      dev = tvm.cuda(0)
      f = tvm.build(
          s,
          [dy, x, dw],
          "cuda --host=llvm",
          name="conv2d_backward_filter",
      )
  
      x = tvm.nd.array(x_np, dev)
      dy = tvm.nd.array(dy_np, dev)
      dw = tvm.nd.array(dw_np, dev)
  
      f(dy, x, dw)
      tvm.testing.assert_allclose(dw.numpy(), dw_np, atol=tol, rtol=tol)
  
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 10 for calling a global function with example usage: verify_conv2d_backward_filter(data_dtype, conv_dtype, tensor_format, tol) without return types