code: def convert_model_dense_to_sparse(
      mod,
      params,
      random_params=False,
      bs_r=1,
      bs_c=1,
      sparsity=0.85,
      layout="NHWC",
  ):
      """Convert a dense model to sparse model.
  
      Parameters
      ----------
      mod : tvm.Module
          The dense model.
      params : Dict[Srting, tvm.nd.array]
          Parameters of the dense model.
      random_params : Bool = False
          True to replace the parameters of the dense model with some random sparse tensors.
          This is mainly used for testing.
      bs_r : int
          The row of BSR matrix block.
      bs_c : int
          The column of BSR matrix block.
      sparsity : float
          The sparsity of the random sparse parameters.
      layout : str
          layout of network
  
      Returns
      -------
      tvm.Module
          The updated sparse model.
      Dict[Srting, tvm.nd.array]
          The updated parameters.
      """
  
      mod, params = ddo.simplify_fc_transpose.convert(
          mod["main"], params
      )
      if random_params:
          # Manually replace the parameters of dense to sparse tensors
          params = random_sparse_dense_params(
              mod, params, bs_r=bs_r, bs_c=bs_c, density=1 - sparsity
          )
          # Manually replace the parameters of conv2d to sparse tensors
          params = random_sparse_conv2d_params(
              mod,
              params,
              bs_r=bs_r,
              bs_c=bs_c,
              density=1 - sparsity,
              layout=layout,
          )
      # convert dense matmul to sparse matmul
      mod, params = ddo.bsr_dense.convert(
          mod, params, (bs_r, bs_c), sparsity_threshold=0.8
      )
      # convert dense conv2d to sparse conv2d
      mod, params = ddo.bsr_conv2d.convert(
          mod,
          params,
          (bs_r, bs_c),
          sparsity_threshold=0.8,
          layout=layout,
      )
  
      return tvm.IRModule.from_expr(mod), params
  
file_path: tvm/python/tvm/topi/sparse/utils.py
imports: import tvm
  from tvm import relay, auto_scheduler
  from tvm.relay import data_dep_optimization
  from tvm.auto_scheduler import _ffi_api
label_desc: Use image node_id 4 for calling a global function with example usage: convert_model_dense_to_sparse(mod, params, random_params, bs_r, bs_c, sparsity, layout) and returns: tvm,  params