@@ -904,8 +904,8 @@ def _impl(inputs, attr, params, mod):
904
904
905
905
906
906
def _sparse_tensor_dense_matmul ():
907
- # Sparse utility from Numpy
908
- from scipy import sparse
907
+ # Sparse utility from scipy
908
+ from scipy . sparse import csr_matrix
909
909
910
910
def _impl (inputs , attr , params , mod ):
911
911
assert len (inputs ) == 4 , "There should be 4 input tensors"
@@ -919,11 +919,11 @@ def _impl(inputs, attr, params, mod):
919
919
rows = [x [0 ] for x in indices_tensor ]
920
920
cols = [x [1 ] for x in indices_tensor ]
921
921
922
- # Create Numpy sparse Tensor(CSR)
923
- weight_sp = sparse . csr_matrix (
922
+ # Create scipy sparse Tensor(CSR)
923
+ weight_sp = csr_matrix (
924
924
(values_tensor , (rows , cols )), shape = tuple (dense_shape_tensor .tolist ())
925
925
)
926
- weight_sp = sparse . csr_matrix (weight_sp .transpose ())
926
+ weight_sp = csr_matrix (weight_sp .transpose ())
927
927
928
928
weight_data = _expr .const (weight_sp .data , weight_sp .data .dtype )
929
929
weight_indptrs = _expr .const (weight_sp .indptr , weight_sp .indptr .dtype )
@@ -935,6 +935,8 @@ def _impl(inputs, attr, params, mod):
935
935
# TODO: Support other adjoint option too
936
936
if attr .get ("adjoint_a" ) and attr .get ("adjoint_b" ):
937
937
ret = _op .transpose (ret )
938
+ else :
939
+ raise tvm .error .OpAttributeUnImplemented ("Adjoint option is not supported yet." )
938
940
939
941
return ret
940
942
0 commit comments