code: def test_sparse_dense_bsr_randomized():
      for _ in range(20):
          BS_R = np.random.randint(1, 16)
          BS_C = np.random.randint(1, 16)
          M = np.random.randint(1, 32)
          N = int(np.random.randint(1, 16) * BS_R)
          K = int(np.random.randint(1, 16) * BS_C)
          density = np.clip(np.random.random(), 0.1, 0.9)
          X_np = np.random.randn(M, K).astype("float32")
          W_sp_np = random_bsr_matrix(
              N, K, BS_R, BS_C, density=density, dtype="float32"
          )
  
          W_np = W_sp_np.todense()
          Y_np = np.array(X_np.dot(W_np.T))
  
          W_data = te.placeholder(
              shape=W_sp_np.data.shape, dtype=str(W_sp_np.data.dtype)
          )
          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))
  
          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)
              fcompute, fschedule = tvm.topi.testing.dispatch(
                  device, _sparse_dense_implement
              )
              with tvm.target.Target(device):
                  Y = fcompute(X, W_data, W_indices, W_indptr)
                  s = fschedule([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.data, device=dev),
                      tvm.nd.array(W_sp_np.indices, device=dev),
                      tvm.nd.array(W_sp_np.indptr, device=dev),
                      Y_tvm,
                  )
                  tvm.testing.assert_allclose(
                      Y_tvm.numpy(), Y_np, atol=1e-5, rtol=1e-5
                  )
  
          for device in ["llvm", "cuda"]:
              check_device(device)
  
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 17 for calling a global function with example usage: test_sparse_dense_bsr_randomized() without return types