Skip to content

Commit

Permalink
bugfix 6a2492d
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante committed Jun 13, 2018
1 parent 6a2492d commit 143317c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions graphtools/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,9 @@ def build_kernel(self):
elif self.precomputed is "adjacency":
# need to set diagonal to one to make it an affinity matrix
K = self.data_nu
if not (isinstance(K, sparse.dok_matrix) or
isinstance(K, sparse.lil_matrix)):
if sparse.issparse(K) and \
not (isinstance(K, sparse.dok_matrix) or
isinstance(K, sparse.lil_matrix)):
K = K.tolil()
K = set_diagonal(K, 1)
else:
Expand Down

0 comments on commit 143317c

Please sign in to comment.