code: def verify_sparse_conv2d_bsr(
      M, H, W, N, K, BS_R, BS_C, density, layout
  ):
      if layout == "NHWC":
          X_np = np.random.randn(M, H, W, K).astype("float32")
      elif layout == "NCHW":
          X_np = np.random.randn(M, K, H, W).astype("float32")
      W_sp_np = random_bsr_matrix(
          N, K, BS_R, BS_C, density=density, dtype="float32"
      )
      W_np = W_sp_np.todense()
      if layout == "NHWC":
          Y_np = tvm.topi.testing.conv2d_nhwc_python(
              X_np, np.array(W_np).T.reshape(1, 1, K, N), 1, 0
          )
      elif layout == "NCHW":
          Y_np = tvm.topi.testing.conv2d_nchw_python(
              X_np, np.array(W_np).reshape(N, K, 1, 1), 1, 0
          )
  
      if BS_C == 1:
          W_data = te.placeholder(
              shape=W_sp_np.data.shape[:-1],
              dtype=str(W_sp_np.data.dtype),
          )
          W_sp_np_data = W_sp_np.data.reshape(
              W_sp_np.data.shape[0], BS_R
          )
      else:
          W_data = te.placeholder(
              shape=W_sp_np.data.shape, dtype=str(W_sp_np.data.dtype)
          )
          W_sp_np_data = W_sp_np.data
      W_indices = te.placeholder(
          shape=W_sp_np.indices.shape, dtype=str(W_sp_np.indices.dtype)
      )
      W_indptr = te.placeholder(
          shape=W_sp_np.indptr.shape, dtype=str(W_sp_np.indptr.dtype)
      )
      X = te.placeholder(shape=X_np.shape, dtype=str(X_np.dtype))
  
      Y = topi.nn.sparse_conv2d(X, W_data, W_indices, W_indptr, layout)
      s = te.create_schedule(Y.op)
  
      def check_device(device):
          dev = tvm.device(device, 0)
          if not tvm.testing.device_enabled(device):
              print("Skip because %s is not enabled" % device)
              return
          print("Running on target: %s" % device)
  
          func = tvm.build(s, [X, W_data, W_indices, W_indptr, Y])
          Y_tvm = tvm.nd.array(np.zeros(Y_np.shape, dtype="float32"))
          func(
              tvm.nd.array(X_np, dev),
              tvm.nd.array(W_sp_np_data, dev),
              tvm.nd.array(W_sp_np.indices, dev),
              tvm.nd.array(W_sp_np.indptr, dev),
              Y_tvm,
          )
          tvm.testing.assert_allclose(
              Y_tvm.numpy(),
              Y_np.astype("float32"),
              atol=1e-4,
              rtol=1e-4,
          )
  
      check_device("llvm")
  
imports: import numpy
  import tvm
  from tvm import te
  from tvm import topi
  from tvm import relay
  import tvm.topi.testing
  from tvm.topi.utils import get_const_tuple
  import tvm.contrib.sparse
  from collections import namedtuple
  import time
  import scipy.sparse
  import tvm.testing
label_desc: Use image node_id 21 for calling a global function with example usage: verify_sparse_conv2d_bsr(M, H, W, N, K, BS_R, BS_C, density, layout) without return types