code: def dense(data, weight, bias=None):
      """Applies a linear transformation: :math:`Y = XW^T + b`.
      Either data or weight should be tvm.contrib.sparse.CSRNDArray.
  
      Parameters
      ----------
      data : tvm.contrib.sparse.CSRNDArray or te.tensor.Tensor
          2-D with shape [batch, in_dim]
  
      weight : te.tensor.Tensor or tvm.contrib.sparse.CSRNDArray
          2-D with shape [out_dim, in_dim]
  
      bias : te.tensor.Tensor, optional
          1-D with shape [out_dim]
  
      Returns
      -------
      output : tvm.te.Tensor
          2-D with shape [batch, out_dim]
      """
      ret = None
      if isinstance(
          data, tvm.contrib.sparse.CSRPlaceholderOp
      ) and isinstance(weight, te.tensor.Tensor):
          ret = dense_si(
              data.data, data.indices, data.indptr, weight, bias
          )
      elif isinstance(data, te.tensor.Tensor) and isinstance(
          weight, tvm.contrib.sparse.CSRPlaceholderOp
      ):
          ret = dense_sw(
              data, weight.data, weight.indices, weight.indptr, bias
          )
      else:
          raise NotImplementedError(
              "implementation for %s as data and %s as weights, "
              "is not supported yet." % (type(data), type(weight))
          )
      return ret
  
file_path: tvm/python/tvm/topi/sparse/dense.py
imports: from __future__ import absolute_import
  import tvm
  from tvm import te
  from ..None import tag
  from ..utils import simplify
label_desc: Use image node_id 3 for calling a global function with example usage: dense(data, weight, bias) and returns: ret