diff --git a/python/tvm/topi/cuda/sparse.py b/python/tvm/topi/cuda/sparse.py index f445118832211..f68b31ec30efb 100644 --- a/python/tvm/topi/cuda/sparse.py +++ b/python/tvm/topi/cuda/sparse.py @@ -17,6 +17,7 @@ """Sparse operators""" import numpy as np +import scipy.sparse as sp import tvm from tvm import relay, te @@ -360,8 +361,6 @@ def schedule_sparse_dense_padded(outs): def pad_sparse_matrix(matrix, blocksize): """Pad rows of sparse matrix matrix so that they are a multiple of blocksize.""" - import scipy.sparse as sp - assert isinstance(matrix, sp.bsr_matrix) new_entries = np.zeros(matrix.shape[0], dtype=matrix.indptr.dtype) bsr = matrix.blocksize[0] @@ -398,8 +397,6 @@ def _alter_sparse_dense_layout(_attrs, inputs, _tinfos, _out_type): sparse_dense implementation for one that operates on a padded matrix. We also padd the matrix. """ - import scipy.sparse as sp - # TODO(ANSHUMAN87): Handle for sparse_lhs case too if ( isinstance(inputs[1], relay.Constant)