dhruvaray commented on a change in pull request #5447:
URL: https://github.com/apache/incubator-tvm/pull/5447#discussion_r416524977



##########
File path: topi/python/topi/transform.py
##########
@@ -676,3 +676,30 @@ def unravel_index(indices, shape):
     """
 
     return cpp.unravel_index(indices, shape)
+
+def sparse_to_dense(sparse_indices, sparse_values, default_value, 
output_shape):
+    """Converts a sparse representation into a dense tensor.
+       Example::
+       -   sparse_to_dense([[0, 0], [1, 1]], [3, 3], 0, [2, 2]) = [[3, 0], [0, 
3]]
+
+       Parameters
+       ----------
+       sparse_indices : tvm.te.Tensor
+           A 0-D, 1-D, or 2-D tensor of type `int32` or `int64`.
+           `sparse_indices[i]` Contains the complete index where 
`sparse_values[i]` will be placed.
+       sparse_values : tvm.te.Tensor
+           A 0-D or 1-D tensor.
+           Values corresponding to each row of sparse_indices.
+           Or a scalar value to be used for all sparse indices.
+       default_value : tvm.te.Tensor
+          A 0-D tensor of the same type as sparse_values.
+          Value to set for indices not specified in sparse_indices.  Defaults 
to zero.
+       output_shape : list of integers

Review comment:
       Done...




----------------------------------------------------------------
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:
[email protected]


Reply via email to