code: def test_sparse_dense_padded_gpu(target, dev):
      M = 128
      N = 1280
      K = 128
      X_np = np.random.randn(M, K).astype("float32")
      W_sp_np = random_bsr_matrix(
          N, K, 1, 1, density=0.01, dtype="float32"
      )
      W_sp_np_padded = tvm.topi.cuda.pad_sparse_matrix(W_sp_np, 32)
  
      W_np = W_sp_np.todense()
      Y_np = X_np @ W_sp_np.T
  
      W_data = te.placeholder(
          shape=W_sp_np_padded.data.shape,
          dtype=str(W_sp_np_padded.data.dtype),
      )
      W_indices = te.placeholder(
          shape=W_sp_np_padded.indices.shape,
          dtype=str(W_sp_np_padded.indices.dtype),
      )
      W_indptr = te.placeholder(
          shape=W_sp_np_padded.indptr.shape,
          dtype=str(W_sp_np_padded.indptr.dtype),
      )
      X = te.placeholder(shape=X_np.shape, dtype=str(X_np.dtype))
      with tvm.target.Target(target):
          Y = topi.cuda.sparse_dense_padded(
              X, W_data, W_indices, W_indptr
          )
          s = topi.cuda.schedule_sparse_dense_padded([Y])
          func = tvm.build(s, [X, W_data, W_indices, W_indptr, Y])
          Y_tvm = tvm.nd.array(
              np.zeros(Y_np.shape, dtype=Y_np.dtype), device=dev
          )
          func(
              tvm.nd.array(X_np, device=dev),
              tvm.nd.array(W_sp_np_padded.data, device=dev),
              tvm.nd.array(W_sp_np_padded.indices, device=dev),
              tvm.nd.array(W_sp_np_padded.indptr, device=dev),
              Y_tvm,
          )
          tvm.testing.assert_allclose(
              Y_tvm.numpy(), Y_np, atol=1e-5, rtol=1e-5
          )
  
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 18 for calling a global function with example usage: test_sparse_dense_padded_gpu(target, dev) without return types