ANSHUMAN87 commented on a change in pull request #6685:
URL: https://github.com/apache/incubator-tvm/pull/6685#discussion_r516214740



##########
File path: python/tvm/topi/cuda/sparse.py
##########
@@ -367,9 +367,14 @@ def _alter_sparse_dense_layout(_attrs, inputs, _tinfos, 
_out_type):
         and isinstance(inputs[2], relay.Constant)
         and isinstance(inputs[3], relay.Constant)
     ):
-        sparse_matrix = sp.bsr_matrix(
-            (inputs[1].data.asnumpy(), inputs[2].data.asnumpy(), 
inputs[3].data.asnumpy())
-        )
+        if len(inputs[1].data.asnumpy().shape) == 1:

Review comment:
       I understand your confusion here.
   I am refering the 
[link](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.bsr_matrix.html#scipy.sparse.bsr_matrix)
 .
   As you can see the 1-D data is not only fed to bsr_matrix creation, also the 
coordinates (rows, cols) are provided alomg with shape. With this constructor , 
it internally forms indptrs & indices. But in our case, we have set of input as 
data(R x C) , indices & indptrs already, so we are utilizing different 
constructor. 
   
   I hope it helps to resolve your query here. Thanks!  
   
   




----------------------------------------------------------------
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