codeislife99 commented on a change in pull request #7442:
URL: https://github.com/apache/tvm/pull/7442#discussion_r577126119



##########
File path: python/tvm/relay/op/transform.py
##########
@@ -1322,6 +1322,71 @@ def adv_index(inputs):
     return _make.adv_index(Tuple(inputs))
 
 
+def sparse_fill_empty_rows(sparse_indices, sparse_values, dense_shape, 
default_value):
+    """
+    Fill first column of the empty rows with default values for a sparse array.
+    It returns a TupleWrapper with 3 outputs
+    Parameters
+    ----------
+    sparse_indices : relay.Expr
+        A 2-D int64 tensor[N, ndims] of integers containing location of sparse 
values, where N is
+        the number of sparse values and n_dim is the number of dimensions of 
the dense_shape.
+        The inputs for this relay parameter must be in row-major order.
+    sparse_values : relay.Expr
+        A 1-D int64 tensor[N] containing the sparse values for the sparse 
indices.
+    dense_shape : relay.Expr
+        A 1-D int64 tensor[ndims] which contains shape of the dense output 
tensor.
+    default_value : relay.Expr
+        A 1-D tensor[1] containing the default value for the remaining 
locations.
+    Returns
+    -------
+    new_sparse_indices : relay.Expr
+        A 2-D int64 tensor[?, ndims] of integers containing location of new 
sparse
+        indices
+    new_sparse_values : relay.Expr
+        A 1-D int64 tensor[?] containing the sparse values for the sparse 
indices.
+    empty_row_indicator : relay.Expr
+        A 1-D int64 tensor[dense_shape[0]] filled with zeros and ones
+        indicating whether the particular row is empty or full respectively
+
+    Note:

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