dhruvaray commented on a change in pull request #5447: URL: https://github.com/apache/incubator-tvm/pull/5447#discussion_r430402869
########## File path: topi/include/topi/transform.h ########## @@ -1309,5 +1309,57 @@ inline Tensor one_hot(const Tensor& indices, const PrimExpr on_value, const Prim name, tag); } +/*! + * \brief Get a dense tensor. + * \param sparse_indices sparse_indices[i] contains the complete index where sparse_values[i] will be placed. + * \param sparse_values is a 0-D or 1-D tensor. Values corresponding to each row of sparse_indices + * \param default_value is a 0-D tensor. Defaults to zero. + * \param output_shape is the shape of the dense output tensor + * \param name output tensor name. + * \param tag output tensor tag. + * \return Tensor of output_shape. + */ +inline Tensor sparse_to_dense(const Tensor& sparse_indices, + const Tensor& sparse_values, + const Tensor& default_value, + const Array<Integer>& output_shape, Review comment: @siju-samuel : tf 2.0 introduces a top-level wrapper object SparseTensor( https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor) which encapsulates this information (indices, values, dense_shape). The topi layer takes all these pieces of information and hence should be compatible across all frameworks ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org